Free memory pointed by r_value and r_size

This commit is contained in:
Bi-Ruei, Chiu 2016-11-08 13:59:29 +08:00
parent 9b78083824
commit 64505efde4
1 changed files with 9 additions and 3 deletions

View File

@ -35,6 +35,7 @@ asn1c_emit_constraint_checking_code(arg_t *arg) {
int alphabet_table_compiled;
int produce_st = 0;
int ulong_optimize = 0;
int ret = 0;
ct = expr->combined_constraints;
if(ct == NULL)
@ -158,7 +159,7 @@ asn1c_emit_constraint_checking_code(arg_t *arg) {
OUT("\n");
OUT("/* Constraint check succeeded */\n");
OUT("return 0;\n");
return 0;
goto end;
}
/*
@ -197,7 +198,8 @@ asn1c_emit_constraint_checking_code(arg_t *arg) {
INDENTED(OUT("/* Nothing is here. See below */\n"));
OUT("}\n");
OUT("\n");
return 1;
ret = 1;
goto end;
}
INDENT(-1);
OUT(") {\n");
@ -222,7 +224,11 @@ asn1c_emit_constraint_checking_code(arg_t *arg) {
INDENT(-1);
OUT("}\n");
return 0;
end:
if (r_value) asn1constraint_range_free(r_value);
if (r_size) asn1constraint_range_free(r_size);
return ret;
}
static int