Commit 5230c64b authored by Lev Walkin's avatar Lev Walkin

pdu types leak fix

parent 42457fe9
...@@ -43,6 +43,7 @@ static int generate_preamble(arg_t *, FILE *, int optc, char **argv); ...@@ -43,6 +43,7 @@ static int generate_preamble(arg_t *, FILE *, int optc, char **argv);
static int include_type_to_pdu_collection(arg_t *arg); static int include_type_to_pdu_collection(arg_t *arg);
static void pdu_collection_print_unused_types(arg_t *arg); static void pdu_collection_print_unused_types(arg_t *arg);
static const char *generate_pdu_C_definition(void); static const char *generate_pdu_C_definition(void);
static void asn1c__cleanup_pdu_type(void);
int int
asn1c_save_compiled_output(arg_t *arg, const char *datadir, asn1c_save_compiled_output(arg_t *arg, const char *datadir,
...@@ -198,6 +199,8 @@ asn1c_save_compiled_output(arg_t *arg, const char *datadir, ...@@ -198,6 +199,8 @@ asn1c_save_compiled_output(arg_t *arg, const char *datadir,
fclose(mkf); fclose(mkf);
safe_fprintf(stderr, "Generated Makefile.am.sample\n"); safe_fprintf(stderr, "Generated Makefile.am.sample\n");
asn1c__cleanup_pdu_type();
return 0; return 0;
} }
...@@ -601,6 +604,17 @@ asn1c__add_pdu_type(const char *ctypename) { ...@@ -601,6 +604,17 @@ asn1c__add_pdu_type(const char *ctypename) {
pduTypes++; pduTypes++;
} }
static void
asn1c__cleanup_pdu_type() {
int i;
for(i = 0; i < pduTypes; i++) {
free(pduType[i].typename);
}
free(pduType);
pduType = NULL;
pduTypes = 0;
}
static int static int
asn1c__pdu_type_lookup(const char *typename) { asn1c__pdu_type_lookup(const char *typename) {
int i; int i;
......
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