chiark / gitweb /
localectl: fix memleak, jump to finish before returning
authorMichal Sekletar <msekleta@redhat.com>
Fri, 26 Oct 2012 12:15:00 +0000 (14:15 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 28 Oct 2012 00:14:40 +0000 (02:14 +0200)
src/locale/localectl.c

index c05eba0d3edebfcdedbf1cc20d47230547ddae3b..84feb25d521d0a6d612436b34a12dfc5f30f1e3b 100644 (file)
@@ -354,7 +354,8 @@ static int list_locales(DBusConnection *bus, char **args, unsigned n) {
             h->locrectab_offset + h->locrectab_size > st.st_size ||
             h->sumhash_offset + h->sumhash_size > st.st_size) {
                 log_error("Invalid archive file.");
             h->locrectab_offset + h->locrectab_size > st.st_size ||
             h->sumhash_offset + h->sumhash_size > st.st_size) {
                 log_error("Invalid archive file.");
-                return -EBADMSG;
+                r = -EBADMSG;
+                goto finish;
         }
 
         e = (const struct namehashent*) ((const uint8_t*) p + h->namehash_offset);
         }
 
         e = (const struct namehashent*) ((const uint8_t*) p + h->namehash_offset);