Unverified Commit d370b8ea by Shukui Yang Committed by Stéphane Graber

Fix mem leak with realpath

parent e9cab6e4
...@@ -80,16 +80,11 @@ static int ensure_path(char **confpath, const char *path) ...@@ -80,16 +80,11 @@ static int ensure_path(char **confpath, const char *path)
goto err; goto err;
} }
*confpath = strdup(fullpath); *confpath = fullpath;
if (!*confpath) {
ERROR("failed to dup string '%s'", fullpath);
goto err;
}
} }
err = EXIT_SUCCESS; err = EXIT_SUCCESS;
err: err:
free(fullpath);
return err; return err;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment