Commit 83885891 by Justin Spahr-Summers

Bail out if remote->url would be NULL

This fixes a crash from attempting to invoke git__strdup() against NULL.
parent 1e99ce9a
......@@ -131,6 +131,11 @@ int git_remote_load(git_remote **out, git_repository *repo, const char *name)
if ((error = git_config_get_string(&val, config, git_buf_cstr(&buf))) < 0)
goto cleanup;
if (!val) {
error = -1;
goto cleanup;
}
remote->repo = repo;
remote->url = git__strdup(val);
......
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