main - gcc-fanalyzer: zallocate memory for clean buffer
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=8c4459782000ffe8b6c21a710e15464f5905ab3a Commit: 8c4459782000ffe8b6c21a710e15464f5905ab3a Parent: 4ef8f7cde6ea481f96f101dc6189979cf3674cfe Author: Zdenek Kabelac <[email protected]> AuthorDate: Tue Sep 21 18:36:44 2021 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Tue Sep 21 21:03:47 2021 +0200
gcc-fanalyzer: zallocate memory for clean buffer
--- lib/label/hints.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/label/hints.c +1 -1
@@ -821,7 +821,7 @@ static int _read_hint_file(struct cmd_context *cmd, struct dm_list *hints, int *if (!dm_strncpy (hint.vgname, vgname +3 ,sizeof (hint.vgname)))continue ; -if (!(alloc_hint =malloc (sizeof (struct hint )))) { +if (!(alloc_hint =zalloc (sizeof (struct hint )))) { ret =0 ;break ; }