]> granicus.if.org Git - psmisc/commitdiff
peekfd: exit() after perror()
authorCraig Small <csmall@dropbear.xyz>
Mon, 2 Mar 2020 11:27:20 +0000 (22:27 +1100)
committerCraig Small <csmall@dropbear.xyz>
Mon, 2 Mar 2020 11:27:20 +0000 (22:27 +1100)
src/peekfd.c

index 360b2f70439acaacfc032088efc52feee29baeab..36dff041406132316f53a381bb28da185b56958c 100644 (file)
@@ -415,8 +415,10 @@ int main(int argc, char **argv)
                                                if (remove_duplicates) {
                                                        if (lastbuf)
                                                                free(lastbuf);
-                                                       if ( NULL == (lastbuf = malloc(regs.REG_PARAM3)))
+                                                       if ( NULL == (lastbuf = malloc(regs.REG_PARAM3))) {
                                                            perror("lastbuf malloc");
+                                                           exit(1);
+                                                       }
                                                        last_buf_size = regs.REG_PARAM3;
                                                }