Commit 4cd4304f authored by Lev Walkin's avatar Lev Walkin

proper freeing

parent c16cf431
...@@ -54,8 +54,9 @@ asn1p_parse_buffer(const char *buffer, int size /* = -1 */, enum asn1p_flags fla ...@@ -54,8 +54,9 @@ asn1p_parse_buffer(const char *buffer, int size /* = -1 */, enum asn1p_flags fla
assert(a); assert(a);
if(_asn1p_fix_modules(a, "-")) if(_asn1p_fix_modules(a, "-"))
return NULL; /* FIXME: destroy (a) */ return NULL; /* FIXME: destroy (a) */
} else { } else if(a) {
assert(a == NULL); asn1p_free(a);
a = NULL;
} }
return a; return a;
...@@ -110,8 +111,8 @@ asn1p_parse_file(const char *filename, enum asn1p_flags flags) { ...@@ -110,8 +111,8 @@ asn1p_parse_file(const char *filename, enum asn1p_flags flags) {
assert(a); assert(a);
if(_asn1p_fix_modules(a, filename)) if(_asn1p_fix_modules(a, filename))
return NULL; /* FIXME: destroy (a) */ return NULL; /* FIXME: destroy (a) */
} else { } else if(a) {
/* Not always true: assert(a == NULL); */ asn1p_free(a);
a = NULL; a = NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment