proper freeing

This commit is contained in:
Lev Walkin 2005-04-08 10:14:30 +00:00
parent c16cf4314e
commit 4cd4304f00
1 changed files with 5 additions and 4 deletions

View File

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