diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-02-22 17:34:33 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-02-22 17:34:33 -0300 |
commit | 8c1a9899d4460aa19780919f4245c08d7ebba0e9 (patch) | |
tree | 685817907f64133330011eb7db845830c9327a3e /opcode.c | |
parent | 05caf09a36cadaab401bc9a24e29e2cd6e4126d4 (diff) | |
download | lua-8c1a9899d4460aa19780919f4245c08d7ebba0e9.tar.gz lua-8c1a9899d4460aa19780919f4245c08d7ebba0e9.tar.bz2 lua-8c1a9899d4460aa19780919f4245c08d7ebba0e9.zip |
functions "luaI_free" and "luaI_realloc" (or macro "growvector") may be
called with NULL.
Diffstat (limited to 'opcode.c')
-rw-r--r-- | opcode.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -3,7 +3,7 @@ | |||
3 | ** TecCGraf - PUC-Rio | 3 | ** TecCGraf - PUC-Rio |
4 | */ | 4 | */ |
5 | 5 | ||
6 | char *rcs_opcode="$Id: opcode.c,v 3.56 1996/02/08 17:03:20 roberto Exp roberto $"; | 6 | char *rcs_opcode="$Id: opcode.c,v 3.57 1996/02/12 18:32:40 roberto Exp roberto $"; |
7 | 7 | ||
8 | #include <setjmp.h> | 8 | #include <setjmp.h> |
9 | #include <stdlib.h> | 9 | #include <stdlib.h> |
@@ -135,8 +135,7 @@ static char *lua_strconc (char *l, char *r) | |||
135 | if (n > buffer_size) | 135 | if (n > buffer_size) |
136 | { | 136 | { |
137 | buffer_size = n; | 137 | buffer_size = n; |
138 | if (buffer != NULL) | 138 | luaI_free(buffer); |
139 | luaI_free(buffer); | ||
140 | buffer = newvector(buffer_size, char); | 139 | buffer = newvector(buffer_size, char); |
141 | } | 140 | } |
142 | strcpy(buffer,l); | 141 | strcpy(buffer,l); |
@@ -525,8 +524,7 @@ static int do_protectedmain (void) | |||
525 | adjustC(0); /* erase extra slot */ | 524 | adjustC(0); /* erase extra slot */ |
526 | } | 525 | } |
527 | errorJmp = oldErr; | 526 | errorJmp = oldErr; |
528 | if (tf.code) | 527 | luaI_free(tf.code); |
529 | luaI_free(tf.code); | ||
530 | return status; | 528 | return status; |
531 | } | 529 | } |
532 | 530 | ||