misc: Few more resource leak fixes

free after malloc in signals.c
closedir after opendir in diskstat
This commit is contained in:
Craig Small 2016-05-03 21:58:13 +10:00
parent 55f7dd0648
commit d2df396ba9
2 changed files with 2 additions and 0 deletions

View File

@ -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){

View File

@ -93,6 +93,7 @@ static int scan_for_disks(struct procps_diskstat *info)
break;
}
}
closedir(dirp);
return 0;
}