Coverity scan findings - memleaks, unused vars, potential nullptr dereferences

This commit is contained in:
Jan Rybar
2021-05-06 16:30:54 +02:00
committed by Craig Small
parent bf0b3b6522
commit d293b686e4
3 changed files with 7 additions and 2 deletions

3
pmap.c
View File

@@ -352,6 +352,9 @@ static void print_extended_maps (FILE *f)
if (listnode == NULL) {
assert(firstmapping == 2);
listnode = calloc(1, sizeof *listnode);
if (listnode == NULL)
xerrx(EXIT_FAILURE, _("ERROR: memory allocation failed"));
if (listhead == NULL) {
assert(listtail == NULL);
listhead = listnode;