Fixed memory freeing
1 files changed, 3 insertions(+), 9 deletions(-)

M src/notify.c
M src/notify.c +3 -9
@@ 47,16 47,10 @@ static void dbus_method_call(GDBusConnec
 		int32_t expire_timeout;
 		g_variant_get(parameters, "(&su&s&s&sasa{sv}i)", &app_name, &replaces_id, &app_icon, &summary, &body, &actions, &hints, &expire_timeout);
 		g_variant_iter_free(actions);
-		if(notif_data[0] != NULL) {
-			free(notif_data[0]);
+		for(size_t count = 0; notif_data[count] != NULL; ++count) {
+			free(notif_data[count]);
 		}
-		if(notif_data[1] != NULL) {
-			free(notif_data[1]);
-		}
-		if(notif_data[2] != NULL) {
-			free(notif_data[2]);
-		}
-		char id_str[11];
+		char* id_str = malloc(11);
 		snprintf(id_str, 11, "%" PRIu32, ++id);
 		notif_data[0] = id_str;
 		notif_data[1] = strdup(app_name);