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)
goto err;
}
*confpath = strdup(fullpath);
if (!*confpath) {
ERROR("failed to dup string '%s'", fullpath);
goto err;
}
*confpath = fullpath;
}
err = EXIT_SUCCESS;
err:
free(fullpath);
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