diff options
author | Waldemar Celes <celes@tecgraf.puc-rio.br> | 1994-04-13 19:10:21 -0300 |
---|---|---|
committer | Waldemar Celes <celes@tecgraf.puc-rio.br> | 1994-04-13 19:10:21 -0300 |
commit | ed80de37d9f61493daa50c28a9b427c19df17edf (patch) | |
tree | 167e5c183574d84e8063b28582549dbfa284a272 | |
parent | 8ca980966ca383c120dadb2c6e6a0850d1bfff58 (diff) | |
download | lua-ed80de37d9f61493daa50c28a9b427c19df17edf.tar.gz lua-ed80de37d9f61493daa50c28a9b427c19df17edf.tar.bz2 lua-ed80de37d9f61493daa50c28a9b427c19df17edf.zip |
Correcao de bug: uma string ja' existente na tabela de string nao
estava sendo liberada.
-rw-r--r-- | table.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -3,7 +3,7 @@ | |||
3 | ** Module to control static tables | 3 | ** Module to control static tables |
4 | */ | 4 | */ |
5 | 5 | ||
6 | char *rcs_table="$Id: table.c,v 1.3 1994/03/28 15:15:59 celes Exp celes $"; | 6 | char *rcs_table="$Id: table.c,v 1.4 1994/04/06 12:55:08 celes Exp celes $"; |
7 | 7 | ||
8 | #include <stdlib.h> | 8 | #include <stdlib.h> |
9 | #include <string.h> | 9 | #include <string.h> |
@@ -232,7 +232,10 @@ char *lua_createstring (char *s) | |||
232 | 232 | ||
233 | for (i=0; i<lua_nstring; i++) | 233 | for (i=0; i<lua_nstring; i++) |
234 | if (streq(s,lua_string[i])) | 234 | if (streq(s,lua_string[i])) |
235 | return s; | 235 | { |
236 | free(s-1); | ||
237 | return lua_string[i]; | ||
238 | } | ||
236 | 239 | ||
237 | if (lua_nstring >= MAXSTRING-1) | 240 | if (lua_nstring >= MAXSTRING-1) |
238 | { | 241 | { |