Commit 3ae937d5 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

cg: props -- Fix resource leak on realloc failure

 | *** CID 161426:  Resource leaks  (RESOURCE_LEAK)
 | /criu/cgroup-props.c: 318 in cgp_parse_stream()
 | 312                             }
 | 313
 | 314                             if (xrealloc_safe(&cgp_entry->cgp.props,
 | 315                                               (cgp_entry->cgp.nr_props + 1) * sizeof(char *))) {
 | 316                                     pr_err("Can't allocate property for controller %s\n",
 | 317                                            cgp_entry->cgp.name);
 | >>>     CID 161426:  Resource leaks  (RESOURCE_LEAK)
 | >>>     Variable "cgp_entry" going out of scope leaks the storage it points to.
 | 318                                     return -1;
 | 319                             }
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent a439bafe
......@@ -315,7 +315,7 @@ static int cgp_parse_stream(char *stream, size_t len)
(cgp_entry->cgp.nr_props + 1) * sizeof(char *))) {
pr_err("Can't allocate property for controller %s\n",
cgp_entry->cgp.name);
return -1;
goto err_parse;
}
cgp_entry->cgp.props[cgp_entry->cgp.nr_props++] = p;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment