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:
Oleg Nesterov 2015-03-29 19:24:07 +02:00 committed by Pavel Emelyanov
parent 69600335a9
commit 79e0b37c4e

View file

@ -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;