Преглед на файлове

libdpkg: Do not leak triggersdir

Guillem Jover преди 15 години
родител
ревизия
55f9704e40
променени са 1 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. 4 1
      lib/dpkg/trigdeferred.l

+ 4 - 1
lib/dpkg/trigdeferred.l

@@ -91,7 +91,7 @@ static const struct trigdefmeths *trigdef;
 
 
 /*---------- Deferred file handling ----------*/
 /*---------- Deferred file handling ----------*/
 
 
-static const char *triggersdir;
+static char *triggersdir;
 static int lock_fd = -1;
 static int lock_fd = -1;
 static FILE *old_deferred;
 static FILE *old_deferred;
 static FILE *trig_new_deferred;
 static FILE *trig_new_deferred;
@@ -234,6 +234,9 @@ trigdef_process_done(void)
 		dir_sync_path(triggersdir);
 		dir_sync_path(triggersdir);
 	}
 	}
 
 
+	free(triggersdir);
+	triggersdir = NULL;
+
 	/* Unlock. */
 	/* Unlock. */
 	pop_cleanup(ehflag_normaltidy);
 	pop_cleanup(ehflag_normaltidy);
 }
 }