mirror of https://gerrit.osmocom.org/asn1c
proper freeing
This commit is contained in:
parent
c16cf4314e
commit
4cd4304f00
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue