[systemd-devel] [PATCH 2/5] localectl: fix memleak, jump to finish before returning

Michal Sekletar msekleta at redhat.com
Fri Oct 26 05:15:00 PDT 2012


---
 src/locale/localectl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/locale/localectl.c b/src/locale/localectl.c
index c05eba0..84feb25 100644
--- a/src/locale/localectl.c
+++ b/src/locale/localectl.c
@@ -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.");
-                return -EBADMSG;
+                r = -EBADMSG;
+                goto finish;
         }
 
         e = (const struct namehashent*) ((const uint8_t*) p + h->namehash_offset);
-- 
1.7.11.7



More information about the systemd-devel mailing list