qt: Use gpgrt_asprintf instead of qstrdup
* lang/qt/src/dn.cpp (parse_dn_part): Use gpgrt_asprintf instead
of qstrdup.
--
This fixes a new / free mismatch because qstrdup uses new and
the allocated parts are freed with free. Similar to: a09ed3f2
This commit is contained in:
parent
d2240a2a18
commit
9d5048d474
@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
#include "dn.h"
|
#include "dn.h"
|
||||||
|
|
||||||
#include <strings.h>
|
#include <gpg-error.h>
|
||||||
|
|
||||||
static const struct {
|
static const struct {
|
||||||
const char *name;
|
const char *name;
|
||||||
@ -167,7 +167,7 @@ parse_dn_part(DnPair *array, const unsigned char *string)
|
|||||||
for (unsigned int i = 0; i < numOidMaps; ++i)
|
for (unsigned int i = 0; i < numOidMaps; ++i)
|
||||||
if (!strcasecmp((char *)p, oidmap[i].oid)) {
|
if (!strcasecmp((char *)p, oidmap[i].oid)) {
|
||||||
free(p);
|
free(p);
|
||||||
p = qstrdup(oidmap[i].name);
|
gpgrt_asprintf(&p, oidmap[i].name);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
array->key = p;
|
array->key = p;
|
||||||
|
Loading…
Reference in New Issue
Block a user