set obj to NULL to avoid double free in case of an error
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2479 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
25950cb01a
commit
f8d6634339
|
@ -1356,6 +1356,7 @@ static int asn1_encode(sc_context_t *ctx, const struct sc_asn1_entry *asn1,
|
||||||
buf = tmp;
|
buf = tmp;
|
||||||
memcpy(buf + total, obj, objsize);
|
memcpy(buf + total, obj, objsize);
|
||||||
free(obj);
|
free(obj);
|
||||||
|
obj = NULL;
|
||||||
total += objsize;
|
total += objsize;
|
||||||
}
|
}
|
||||||
*ptr = buf;
|
*ptr = buf;
|
||||||
|
|
Loading…
Reference in New Issue