notes-utils: handle boolean notes.rewritemode correctly
authorJohn Keeping <john@keeping.me.uk>
Sun, 16 Feb 2014 16:06:02 +0000 (16:06 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 18 Feb 2014 23:51:29 +0000 (15:51 -0800)
If we carry on after outputting config_error_nonbool then we're
guaranteed to dereference a null pointer.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
notes-utils.c
index 2975dcd581024cd483953b47636466b79c95bafe..4aa7023903374aa3ccea23d5fc9ae82c9c67bca7 100644 (file)
@@ -75,7 +75,7 @@ static int notes_rewrite_config(const char *k, const char *v, void *cb)
                return 0;
        } else if (!c->mode_from_env && !strcmp(k, "notes.rewritemode")) {
                if (!v)
-                       config_error_nonbool(k);
+                       return config_error_nonbool(k);
                c->combine = parse_combine_notes_fn(v);
                if (!c->combine) {
                        error(_("Bad notes.rewriteMode value: '%s'"), v);