]> git.notmuchmail.org Git - notmuch/blobdiff - notmuch-index-message.cc
Fix a one-time memory leak.
[notmuch] / notmuch-index-message.cc
index 3175d2d829b26b9c8db72d9d962bdf141cdb9851..dfb1825edccb578566b8a33105a508710feb9119 100644 (file)
@@ -486,6 +486,10 @@ gen_terms_body_str (Xapian::TermGenerator term_gen,
        while (*next_line == '\n')
            next_line++;
 
+       /* Skip blank lines. */
+       if (line_end < line)
+           continue;
+
        /* Skip lines that are quotes. */
        if (*line == '>')
            continue;
@@ -813,6 +817,8 @@ main (int argc, char **argv)
            }
        }
 
+       g_io_channel_unref (channel);
+
        gettimeofday (&tv_now, NULL);
        elapsed = (tv_now.tv_sec - tv_start.tv_sec +
                   (tv_now.tv_usec - tv_start.tv_usec) / 1e6);