mirror of
https://github.com/tmux/tmux.git
synced 2025-01-12 03:08:46 +00:00
Sync OpenBSD patchset 859:
Free old argument even if setting to NULL.
This commit is contained in:
parent
d718a14bd0
commit
19e81ffda5
11
arguments.c
11
arguments.c
@ -1,4 +1,4 @@
|
||||
/* $Id: arguments.c,v 1.2 2011-01-07 14:46:57 tcunha Exp $ */
|
||||
/* $Id: arguments.c,v 1.3 2011-02-15 15:24:40 tcunha Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2010 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -182,11 +182,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 (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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user