summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2005-04-26 03:08:38 +0000
committerJason Woodward2005-04-26 03:08:38 +0000
commit122659202fd2185594fc806ced3671c748f557a1 (patch)
tree25a6f70978c46a9d6603240555ce4abcc385c931
parente13d56c5b49c47b5600538c2dd473ecc03402d75 (diff)
downloadslapt-get-122659202fd2185594fc806ced3671c748f557a1.tar.gz
free locally created pkg list in purge_old_cached_pkgs()
-rw-r--r--ChangeLog1
-rw-r--r--src/package.c9
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 2199423..9395efd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
0.9.9k Apr 25, 2005
+ * free locally created pkg list in purge_old_cached_pkgs()
* added libcurl option CURLOPT_FOLLOWLOCATION so HTTP redirects are followed
* initialized source in sources list [fixing valgrind warning]
* updated FAQ
diff --git a/src/package.c b/src/package.c
index 9c85efe..6b2ab38 100644
--- a/src/package.c
+++ b/src/package.c
@@ -1940,8 +1940,12 @@ void purge_old_cached_pkgs(const rc_config *global_config,char *dir_name,struct
struct dirent *file;
struct stat file_stat;
sg_regex cached_pkgs_regex;
+ int local_pkg_list = 0;
- if( avail_pkgs == NULL ) avail_pkgs = get_available_pkgs();
+ if( avail_pkgs == NULL ){
+ avail_pkgs = get_available_pkgs();
+ local_pkg_list = 1;
+ }
if( dir_name == NULL ) dir_name = (char *)global_config->working_dir;
init_regex(&cached_pkgs_regex,PKG_PARSE_REGEX);
@@ -2028,6 +2032,9 @@ void purge_old_cached_pkgs(const rc_config *global_config,char *dir_name,struct
closedir(dir);
free_regex(&cached_pkgs_regex);
+ if( local_pkg_list == 1 ){
+ free_pkg_list(avail_pkgs);
+ }
}