summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/map/magic-interpreter-base.c3
-rw-r--r--src/map/magic.c2
2 files changed, 5 insertions, 0 deletions
diff --git a/src/map/magic-interpreter-base.c b/src/map/magic-interpreter-base.c
index 0ece700..9d21832 100644
--- a/src/map/magic-interpreter-base.c
+++ b/src/map/magic-interpreter-base.c
@@ -191,8 +191,11 @@ env_t *spell_create_env (magic_conf_t * conf, spell_t * spell,
}
case SPELLARG_NONE:
+ free (param);
break;
+
default:
+ free (param);
fprintf (stderr, "Unexpected spellarg type %d\n",
spell->spellarg_ty);
}
diff --git a/src/map/magic.c b/src/map/magic.c
index 8e9c80e..572203f 100644
--- a/src/map/magic.c
+++ b/src/map/magic.c
@@ -131,6 +131,8 @@ int magic_message (character_t * caster, char *spell_, size_t spell_len)
}
return 1;
}
+ else
+ free (parameter);
return 0; /* Not a spell */
}