mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-29 04:50:26 +00:00
parse_mountinfo_ent: xrealloc(new->mountpoint) can fail
This is pure theoretical, especially in this particular case when we actually want to (likely) free the unused memory. Still the code which ignores potential error doesn't look good. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
69600335a9
commit
79e0b37c4e
1 changed files with 2 additions and 0 deletions
|
|
@ -962,6 +962,8 @@ static int parse_mountinfo_ent(char *str, struct mount_info *new, char **fsname)
|
|||
goto err;
|
||||
|
||||
new->mountpoint = xrealloc(new->mountpoint, strlen(new->mountpoint) + 1);
|
||||
if (!new->mountpoint)
|
||||
goto err;
|
||||
|
||||
new->s_dev = MKKDEV(kmaj, kmin);
|
||||
new->flags = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue