Browse Source

libdpkg: Do not leak triggersdir

Guillem Jover 15 years ago
parent
commit
55f9704e40
1 changed files with 4 additions and 1 deletions
  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 ----------*/
 
-static const char *triggersdir;
+static char *triggersdir;
 static int lock_fd = -1;
 static FILE *old_deferred;
 static FILE *trig_new_deferred;
@@ -234,6 +234,9 @@ trigdef_process_done(void)
 		dir_sync_path(triggersdir);
 	}
 
+	free(triggersdir);
+	triggersdir = NULL;
+
 	/* Unlock. */
 	pop_cleanup(ehflag_normaltidy);
 }