summaryrefslogtreecommitdiff
path: root/src/diff_driver.c
diff options
context:
space:
mode:
authorVicent Marti <vicent@github.com>2014-05-14 12:20:24 +0200
committerVicent Marti <vicent@github.com>2014-05-14 12:20:24 +0200
commit2bcc1afd103223fb6cc5f8f538fbf108258f7907 (patch)
tree7ecdfaee5b8699b676fbee468f07cb73b7e1d3b0 /src/diff_driver.c
parenta8af3e02841dea19581021529870f16a69f436ea (diff)
parent2b52a0bfaedf7571e7ecd706947f5865d513760c (diff)
downloadlibgit2-2bcc1afd103223fb6cc5f8f538fbf108258f7907.tar.gz
Merge pull request #2349 from libgit2/rb/coverity-fixes
Increase config snapshot usage
Diffstat (limited to 'src/diff_driver.c')
-rw-r--r--src/diff_driver.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/diff_driver.c b/src/diff_driver.c
index fc1354f36..dc8e79e25 100644
--- a/src/diff_driver.c
+++ b/src/diff_driver.c
@@ -233,17 +233,17 @@ static int git_diff_driver_load(
return 0;
}
+ drv = git__calloc(1, sizeof(git_diff_driver) + namelen + 1);
+ GITERR_CHECK_ALLOC(drv);
+ drv->type = DIFF_DRIVER_AUTO;
+ memcpy(drv->name, driver_name, namelen);
+
/* if you can't read config for repo, just use default driver */
if (git_repository_config_snapshot(&cfg, repo) < 0) {
giterr_clear();
goto done;
}
- drv = git__calloc(1, sizeof(git_diff_driver) + namelen + 1);
- GITERR_CHECK_ALLOC(drv);
- drv->type = DIFF_DRIVER_AUTO;
- memcpy(drv->name, driver_name, namelen);
-
if ((error = git_buf_printf(&name, "diff.%s.binary", driver_name)) < 0)
goto done;