efl/ethumb: Fix more memory leaks in ethumbd_slave.c
authorStefan Schmidt <stefan@datenfreihafen.org>
Mon, 11 Feb 2013 10:54:34 +0000 (10:54 +0000)
committerStefan Schmidt <stefan@datenfreihafen.org>
Mon, 11 Feb 2013 10:54:34 +0000 (10:54 +0000)
MAke sure we free strdup'ed memory when hittign an error case.

SVN revision: 83818

src/bin/ethumb_client/ethumbd_slave.c

index 4a328b8..294421d 100644 (file)
@@ -448,16 +448,30 @@ _ec_frame_set(struct _Ethumbd_Child *ec, Ethumb *e)
      return 0;
    r = _ec_read_safe(STDIN_FILENO, &type, sizeof(type));
    if (!r)
-     return 0;
+     {
+        free(theme_file);
+        return 0;
+     }
    r = _ec_pipe_str_read(ec, &group);
    if (!r)
-     return 0;
+     {
+        free(theme_file);
+        return 0;
+     }
    r = _ec_read_safe(STDIN_FILENO, &type, sizeof(type));
    if (!r)
-     return 0;
+     {
+        free(theme_file);
+        free(group);
+        return 0;
+     }
    r = _ec_pipe_str_read(ec, &swallow);
    if (!r)
-     return 0;
+     {
+        free(theme_file);
+        free(group);
+        return 0;
+     }
    DBG("frame = %s:%s:%s", theme_file, group, swallow);
    ethumb_frame_set(e, theme_file, group, swallow);
    free(theme_file);