1
0
mirror of https://github.com/tmate-io/tmate-ssh-server.git synced 2020-11-18 19:53:51 -08:00

Free old argument even if setting to NULL.

This commit is contained in:
Nicholas Marriott 2011-01-30 12:09:30 +00:00
parent 9fc2c34a3b
commit 567741caf5

View File

@ -183,11 +183,12 @@ args_has(struct args *args, u_char ch)
void
args_set(struct args *args, u_char ch, const char *value)
{
if (value != NULL) {
if (args->values[ch] != NULL)
xfree(args->values[ch]);
if (value != NULL)
args->values[ch] = xstrdup(value);
}
else
args->values[ch] = NULL;
bit_set(args->flags, ch);
}