| # | Line 50 | Line 50 | void getLoadAv() { | |
|---|---|---|
| 50 | ||
| 51 | void getMemInfo() { | |
| 52 | char *line; | |
| 53 | < | char *mem; |
| 54 | < | char *swap; |
| 53 | > | char *mem=NULL; |
| 54 | > | char *swap=NULL; |
| 55 | char *ch; | |
| 56 | long memstat[6]; | |
| 57 | long swapstat[3]; | |
| # | Line 80 | Line 80 | void getMemInfo() { | |
| 80 | errf("Failed to close file (%m)."); | |
| 81 | die(); | |
| 82 | } | |
| 83 | < | |
| 83 | > | |
| 84 | > | if (mem==NULL || swap==NULL){ |
| 85 | > | errf("Failed to obtain information required for memory and swap stats"); |
| 86 | > | die(); |
| 87 | > | } |
| 88 | > | |
| 89 | /* Get the info we want from the 2 read in lines */ | |
| 90 | ||
| 91 | ch = strchr(mem, ' '); | |
| – | Removed lines |
| + | Added lines |
| < | Changed lines |
| > | Changed lines |