mirror of
git://github.com/lxc/lxc
synced 2025-08-31 03:49:34 +00:00
Fix coverity-detected memory leak
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
This commit is contained in:
@@ -109,8 +109,10 @@ struct lxc_list *get_list(char *input, char *delimiter) {
|
||||
lxc_list_init(workstr_list);
|
||||
|
||||
workstr = strdup(input);
|
||||
if (!workstr)
|
||||
if (!workstr) {
|
||||
free(workstr_list);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (workptr = workstr;;workptr = NULL) {
|
||||
token = strtok_r(workptr, delimiter, &sptr);
|
||||
|
Reference in New Issue
Block a user