mirror of https://gerrit.osmocom.org/asn1c
pdu types leak fix
This commit is contained in:
parent
42457fe974
commit
5230c64b7c
|
@ -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 void pdu_collection_print_unused_types(arg_t *arg);
|
||||
static const char *generate_pdu_C_definition(void);
|
||||
static void asn1c__cleanup_pdu_type(void);
|
||||
|
||||
int
|
||||
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);
|
||||
safe_fprintf(stderr, "Generated Makefile.am.sample\n");
|
||||
|
||||
asn1c__cleanup_pdu_type();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -601,6 +604,17 @@ asn1c__add_pdu_type(const char *ctypename) {
|
|||
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
|
||||
asn1c__pdu_type_lookup(const char *typename) {
|
||||
int i;
|
||||
|
|
Loading…
Reference in New Issue