Check for failure in allocations.

This commit is contained in:
Hisham
2016-02-02 15:53:02 +01:00
parent a1f7f2869e
commit b54d2dde40
42 changed files with 141 additions and 134 deletions

2
htop.c
View File

@ -128,7 +128,7 @@ static CommandLineSettings parseArguments(int argc, char** argv) {
flags.useColors = false;
break;
case 'p': {
char* argCopy = strdup(optarg);
char* argCopy = xStrdup(optarg);
char* saveptr;
char* pid = strtok_r(argCopy, ",", &saveptr);