mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 715618 - SharedLibrary operator= doesn't handle self assignment properly. r=matspal
This commit is contained in:
parent
893ef06b30
commit
da0a421974
@ -1,5 +1,5 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* vim:set ts=4 sw=4 sts=4 et cindent: */
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim:set ts=2 sw=2 sts=2 et cindent: */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
@ -59,9 +59,14 @@ public:
|
||||
|
||||
SharedLibrary& operator=(const SharedLibrary& aEntry)
|
||||
{
|
||||
// Gracefully handle self assignment
|
||||
if (this == &aEntry) return *this;
|
||||
|
||||
mStart = aEntry.mStart;
|
||||
mEnd = aEntry.mEnd;
|
||||
mOffset = aEntry.mOffset;
|
||||
if (mName)
|
||||
free(mName);
|
||||
mName = strdup(aEntry.mName);
|
||||
return *this;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user