Fixes to coverity defects 87601 87557 87548 87547 87546 87545 87544 87536 87535 87529 87528

This commit is contained in:
Markus Makela
2015-02-22 22:29:30 +02:00
parent 22255a6045
commit 46c4fefb00
8 changed files with 16 additions and 10 deletions

View File

@ -632,7 +632,8 @@ static bool resolve_maxscale_homedir(
* 3. if /etc/MaxScale/MaxScale.cnf didn't exist or wasn't accessible, home
* isn't specified. Thus, try to access $PWD/MaxScale.cnf .
*/
tmp = strndup(getenv("PWD"), PATH_MAX);
char *pwd = getenv("PWD");
tmp = strndup(pwd ? pwd : "PWD_NOT_SET", PATH_MAX);
tmp2 = get_expanded_pathname(p_home_dir, tmp, default_cnf_fname);
free(tmp2); /*< full path isn't needed so simply free it */