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:
nils 2005-08-10 21:00:52 +00:00
parent 25950cb01a
commit f8d6634339
1 changed files with 1 additions and 0 deletions

View File

@ -1356,6 +1356,7 @@ static int asn1_encode(sc_context_t *ctx, const struct sc_asn1_entry *asn1,
buf = tmp;
memcpy(buf + total, obj, objsize);
free(obj);
obj = NULL;
total += objsize;
}
*ptr = buf;