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
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;
}
......
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