forked from qt-creator/qt-creator
Fix Core::Id cleanup.
qstrdup() uses new[] to allocate the array. Change-Id: I014cfb697d792ff7bae5f1fdc58d8e6069f06e14 Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -39,6 +39,8 @@
|
||||
#include <QHash>
|
||||
#include <QVector>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
namespace Core {
|
||||
|
||||
/*!
|
||||
@@ -107,7 +109,7 @@ static int theId(const char *str)
|
||||
if (lastUid == 0)
|
||||
stringFromId.append(QByteArray());
|
||||
res = ++lastUid;
|
||||
sh.str = qstrdup(sh.str);
|
||||
sh.str = strdup(sh.str);
|
||||
idFromString[sh] = res;
|
||||
stringFromId.append(QByteArray::fromRawData(sh.str, sh.n));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user