fix a couple of memory leaks
authorMichael Rasmussen <mir@datanom.net>
Sat, 15 Nov 2014 19:37:20 +0000 (20:37 +0100)
committerMichael Rasmussen <mir@datanom.net>
Sat, 15 Nov 2014 19:37:20 +0000 (20:37 +0100)
src/ldif.c
src/prefs_gtk.c

index 89f750b..5c57ad5 100644 (file)
@@ -647,8 +647,8 @@ static void ldif_read_file( LdifFile *ldifFile, AddressCache *cache ) {
                                                g_free(fullValue);
                                                fullValue = out;
                                                fullValue[len] = '\0';
-                                       } else
-                                               g_free(out);
+                                       }
+                                       g_free(out);
                                }
                                /* Base-64 encoded data */
                                /*
index e141afd..dc7e5cf 100644 (file)
@@ -400,6 +400,7 @@ gint prefs_write_param(PrefParam *param, FILE *fp)
                                g_snprintf(buf, sizeof(buf), "%s=!%s\n", param[i].name,
                                           tmp ?
                                           tmp : "");
+                               g_free(tmp);
                        }
                        break;
                default: