summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/map/script.c b/src/map/script.c
index b0621aa40..12f9b9313 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -2268,11 +2268,8 @@ static int set_reg(struct script_state* st, TBL_PC* sd, int num, char* name, voi
char* p;
struct linkdb_node** n;
n = (ref) ? ref : (name[1] == '@') ? st->stack->var_function : &st->script->script_vars;
- p = linkdb_search(n, (void*)num);
- if (p) {
- linkdb_erase(n, (void*)num);
- aFree(p);
- }
+ p = linkdb_erase(n, (void*)num);
+ if (p) aFree(p);
if (str[0]) linkdb_insert(n, (void*)num, aStrdup(str));
}
return 1;