misc: Few more resource leak fixes
free after malloc in signals.c closedir after opendir in diskstat
This commit is contained in:
parent
55f7dd0648
commit
d2df396ba9
@ -239,6 +239,7 @@ char *strtosig(const char *restrict s)
|
||||
if (isdigit(*p)){
|
||||
numsignal = strtol(s,&endp,10);
|
||||
if(*endp || endp==s)
|
||||
free(p);
|
||||
return NULL; /* not valid */
|
||||
}
|
||||
if (numsignal){
|
||||
|
@ -93,6 +93,7 @@ static int scan_for_disks(struct procps_diskstat *info)
|
||||
break;
|
||||
}
|
||||
}
|
||||
closedir(dirp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user