diff options
author | vlm <vlm@59561ff5-6e30-0410-9f3c-9617f08c8826> | 2005-04-08 10:14:30 +0000 |
---|---|---|
committer | vlm <vlm@59561ff5-6e30-0410-9f3c-9617f08c8826> | 2005-04-08 10:14:30 +0000 |
commit | 1bc7563ab3b1cdc127e8cc0094ad298e8b568153 (patch) | |
tree | 3057f98ff04a035382efbf3937bdd2a136ba6a05 /libasn1parser | |
parent | 0b43112c6063eb76cd55daf23b5e0104629fdf84 (diff) |
proper freeing
git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@861 59561ff5-6e30-0410-9f3c-9617f08c8826
Diffstat (limited to 'libasn1parser')
-rw-r--r-- | libasn1parser/asn1parser.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libasn1parser/asn1parser.c b/libasn1parser/asn1parser.c index 45f60c31..f6221a56 100644 --- a/libasn1parser/asn1parser.c +++ b/libasn1parser/asn1parser.c @@ -54,8 +54,9 @@ asn1p_parse_buffer(const char *buffer, int size /* = -1 */, enum asn1p_flags fla assert(a); if(_asn1p_fix_modules(a, "-")) return NULL; /* FIXME: destroy (a) */ - } else { - assert(a == NULL); + } else if(a) { + asn1p_free(a); + a = NULL; } return a; @@ -110,8 +111,8 @@ asn1p_parse_file(const char *filename, enum asn1p_flags flags) { assert(a); if(_asn1p_fix_modules(a, filename)) return NULL; /* FIXME: destroy (a) */ - } else { - /* Not always true: assert(a == NULL); */ + } else if(a) { + asn1p_free(a); a = NULL; } |