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:
Christian Kandeler
2012-06-07 14:04:07 +02:00
committed by hjk
parent b25dfed9ff
commit ffb19c510c

View File

@@ -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));
}