aboutsummaryrefslogtreecommitdiffstats
path: root/libasn1parser
diff options
context:
space:
mode:
authorLev Walkin <vlm@lionet.info>2005-04-08 10:14:30 +0000
committerLev Walkin <vlm@lionet.info>2005-04-08 10:14:30 +0000
commit4cd4304f005e0d196b7e914ef4709db5227197f2 (patch)
tree3057f98ff04a035382efbf3937bdd2a136ba6a05 /libasn1parser
parentc16cf4314efb999aece3cf8d70e63d1dd050c795 (diff)
proper freeing
Diffstat (limited to 'libasn1parser')
-rw-r--r--libasn1parser/asn1parser.c9
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;
}