OSDN Git Service

string-list.h: move documentation from Documentation/api/ into header
[git-core/git.git] / mailinfo.c
index bd574cb..f2387a3 100644 (file)
@@ -149,16 +149,14 @@ static void handle_from(struct mailinfo *mi, const struct strbuf *from)
        at = strchr(f.buf, '@');
        if (!at) {
                parse_bogus_from(mi, from);
-               return;
+               goto out;
        }
 
        /*
         * If we already have one email, don't take any confusing lines
         */
-       if (mi->email.len && strchr(at + 1, '@')) {
-               strbuf_release(&f);
-               return;
-       }
+       if (mi->email.len && strchr(at + 1, '@'))
+               goto out;
 
        /* Pick up the string around '@', possibly delimited with <>
         * pair; that is the email part.
@@ -198,6 +196,7 @@ static void handle_from(struct mailinfo *mi, const struct strbuf *from)
        }
 
        get_sane_name(&mi->name, &f, &mi->email);
+out:
        strbuf_release(&f);
 }
 
@@ -929,6 +928,7 @@ again:
                        error("Detected mismatched boundaries, can't recover");
                        mi->input_error = -1;
                        mi->content_top = mi->content;
+                       strbuf_release(&newline);
                        return 0;
                }
                handle_filter(mi, &newline);