Skip to content

Commit ef62300

Browse files
committed
Occasional segmentation fault when atop is combined with netatop
Even when the number of exited processes via netatop was zero, still a malloc was issued. In certain circumstances a structure could have been stored at the address that was returned by malloc, resulting in a segmentation fault on a subsequent malloc.
1 parent 7838d54 commit ef62300

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

netatopif.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,9 @@ netatop_exitstore(void)
344344
nexitnet = nahp->curseq - lastseq;
345345
lastseq = nahp->curseq;
346346

347+
if (nexitnet == 0)
348+
return 0;
349+
347350
/*
348351
** allocate storage for all exited processes
349352
*/

0 commit comments

Comments
 (0)