3 Mar
2017
3 Mar
'17
2:32 p.m.
If guestfs_int_random_string fails, make sure to free the buffer allocated as return string. --- common/edit/file-edit.c | 1 + 1 file changed, 1 insertion(+) diff --git a/common/edit/file-edit.c b/common/edit/file-edit.c index 81b1f1f..b0347e7 100644 --- a/common/edit/file-edit.c +++ b/common/edit/file-edit.c @@ -325,6 +325,7 @@ generate_random_name (const char *filename) */ if (guestfs_int_random_string (p, 8) == -1) { perror ("guestfs_int_random_string"); + free (ret); return NULL; } -- 2.9.3