IBM's BEAM checker.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13589
/* Search the path for the client program */
static const char *find_client(const char *clientname)
{
- char *fullname = NULL;
+ char *fullname;
const char *path = getenv("PATH");
const char *colon;
+ assert(clientname != NULL);
+
+ if (path == NULL) return clientname;
+
/* Make the size of the FULLNAME buffer large enough. */
unsigned need = strlen(path) + strlen("/") + strlen(clientname) + 1;
if (access(fullname, R_OK|X_OK) == 0)
return fullname;
}
+ free(fullname);
return clientname;
}