Commit 463c21e2 by Nelson Elhage

Apply code review feedback

parent 416aafd1
...@@ -43,20 +43,17 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) ...@@ -43,20 +43,17 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
git_config_backend *backend = NULL; git_config_backend *backend = NULL;
int err = 0; int err = 0;
err = git_config_new(&cfg); if ((err = git_config_new(&cfg)) != 0) {
if (err != 0) {
goto out; goto out;
} }
err = git_config_backend_from_string(&backend, (const char*)data, size); if ((err = git_config_backend_from_string(&backend, (const char*)data, size)) != 0) {
if (err != 0) {
goto out; goto out;
} }
err = git_config_add_backend(cfg, backend, 0, NULL, 0); if ((err = git_config_add_backend(cfg, backend, 0, NULL, 0)) != 0) {
if (err != 0) {
goto out; goto out;
} }
// Now owned by the config /* Now owned by the config */
backend = NULL; backend = NULL;
git_config_foreach(cfg, foreach_cb, NULL); git_config_foreach(cfg, foreach_cb, NULL);
......
...@@ -198,7 +198,7 @@ int git_config_backend_from_string(git_config_backend **out, const char *cfg, si ...@@ -198,7 +198,7 @@ int git_config_backend_from_string(git_config_backend **out, const char *cfg, si
return -1; return -1;
} }
if (git_buf_put(&backend->cfg, cfg, len) < 0) { if (git_buf_set(&backend->cfg, cfg, len) < 0) {
git_config_entries_free(backend->entries); git_config_entries_free(backend->entries);
git__free(backend); git__free(backend);
return -1; return -1;
......
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