mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-25 15:51:24 +02:00
BUG/MINOR: arg: don't try to add an argument on failed memory allocation
Take care of arg_list_clone() returning NULL in arg_list_add() since the former does it too. It's only used during parsing so the impact is very low. Can be backported to 1.7, 1.6 and 1.5.
This commit is contained in:
parent
1822e8c356
commit
a9e2e4b899
@ -72,9 +72,11 @@ struct arg_list *arg_list_add(struct arg_list *orig, struct arg *arg, int pos)
|
|||||||
struct arg_list *new;
|
struct arg_list *new;
|
||||||
|
|
||||||
new = arg_list_clone(orig);
|
new = arg_list_clone(orig);
|
||||||
|
if (new) {
|
||||||
new->arg = arg;
|
new->arg = arg;
|
||||||
new->arg_pos = pos;
|
new->arg_pos = pos;
|
||||||
LIST_ADDQ(&orig->list, &new->list);
|
LIST_ADDQ(&orig->list, &new->list);
|
||||||
|
}
|
||||||
return new;
|
return new;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user