]> granicus.if.org Git - yasm/commitdiff
x86_bc_resolve_jmprel(): Plug memory leak.
authorPeter Johnson <peter@tortall.net>
Fri, 1 Nov 2002 20:39:03 +0000 (20:39 -0000)
committerPeter Johnson <peter@tortall.net>
Fri, 1 Nov 2002 20:39:03 +0000 (20:39 -0000)
svn path=/trunk/yasm/; revision=793

modules/arch/x86/x86bc.c
src/arch/x86/x86bc.c

index 5eae04b64c58bf1b72ed00ef251da84d78cbe96f..5b13e0488e040fc85d673d6529424d75edf5e97a 100644 (file)
@@ -663,10 +663,12 @@ x86_bc_resolve_jmprel(x86_jmprel *jmprel, unsigned long *len, int save,
                if (!num) {
                    cur_we->error(bc->line,
                        N_("short jump target external or out of segment"));
+                   expr_delete(temp);
                    return BC_RESOLVE_ERROR | BC_RESOLVE_UNKNOWN_LEN;
                } else {
                    rel = intnum_get_int(num);
                    rel -= jmprel->shortop.opcode_len+1;
+                   expr_delete(temp);
                    /* does a short form exist? */
                    if (jmprel->shortop.opcode_len == 0) {
                        cur_we->error(bc->line,
index 5eae04b64c58bf1b72ed00ef251da84d78cbe96f..5b13e0488e040fc85d673d6529424d75edf5e97a 100644 (file)
@@ -663,10 +663,12 @@ x86_bc_resolve_jmprel(x86_jmprel *jmprel, unsigned long *len, int save,
                if (!num) {
                    cur_we->error(bc->line,
                        N_("short jump target external or out of segment"));
+                   expr_delete(temp);
                    return BC_RESOLVE_ERROR | BC_RESOLVE_UNKNOWN_LEN;
                } else {
                    rel = intnum_get_int(num);
                    rel -= jmprel->shortop.opcode_len+1;
+                   expr_delete(temp);
                    /* does a short form exist? */
                    if (jmprel->shortop.opcode_len == 0) {
                        cur_we->error(bc->line,