asn1: fix use-after-free in asn1_write
authorJeff Layton <jlayton@samba.org>
Mon, 14 Oct 2013 01:07:28 +0000 (21:07 -0400)
committerJeff Layton <jlayton@samba.org>
Mon, 14 Oct 2013 10:25:45 +0000 (06:25 -0400)
commit3aa83995d7c0ef632fe0af3d032e48691a5ce781
tree3a429ac954e64560bde42a9057b4dbe422a4d6d7
parent7e2e95d0c84bd6960c46f1fa1c8227c50dd7a4b3
asn1: fix use-after-free in asn1_write

If the talloc_realloc() fails, asn1_write calls talloc_free on the
context and then immediately dereferences the pointer.

Fix this by skipping the talloc_free here. Let the caller handle it.

Signed-off-by: Jeff Layton <jlayton@samba.org>
asn1.c