X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fpopen.c;h=94ad583f78770dfac294e5ee3b91376c0b2b3fc4;hb=7e2e599660083e1ce6de6d9230e456d9a4e3772d;hp=98ba085b79bb9e989643849b1297cee2cf02f361;hpb=41158497e887d2d9cd925574f349fd3e65402644;p=nagiosplug.git diff --git a/plugins/popen.c b/plugins/popen.c index 98ba085..94ad583 100644 --- a/plugins/popen.c +++ b/plugins/popen.c @@ -16,10 +16,11 @@ int spclose(FILE *); * path passed to the exec'd program are esstially empty. (popen create a shell * and passes the environment to it). * + * $Id$ + * ******************************************************************************/ -#include -#include +#include "common.h" /* extern so plugin has pid to kill exec'd process on timeouts */ extern int timeout_interval; @@ -111,6 +112,7 @@ spopen (const char *cmdstring) /* there cannot be more args than characters */ argc = strlen (cmdstring) + 1; /* add 1 for NULL termination */ argv = malloc (sizeof(char*)*argc); + if (argv == NULL) { printf ("Could not malloc argv array in popen()\n"); return NULL; @@ -122,7 +124,7 @@ spopen (const char *cmdstring) str += strspn (str, " \t\r\n"); /* trim any leading whitespace */ if (i >= argc - 2) { - printf ("You've got a big problem buddy! You need more args!!!\n"); + printf ("CRITICAL - You need more args!!!\n"); return (NULL); }