Commit 222cd8e2 authored by Bernhard Link's avatar Bernhard Link

fix segfault and memory leaks in checkupdate and checkpull

parent 1f2357af
......@@ -3,6 +3,7 @@
* repair checkupdate statistics of newest available
version of checkupdate when using delete rules.
(Showed 'unavailable for reload').
* fix segfault and memory leak in checkupdate
2006-04-29 Bernhard R. Link <brlink@debian.org>
* fix some minor memory leaks
......
......@@ -7,6 +7,7 @@ Updates since 0.8.2:
Those are roughly equivalent to upgrade rules with
file:/path/to/basedir Method, but faster and a bit
more limited (files cannot change components)
- fix segfault of checkupdate
Updates since 0.8.1:
- mark process list files and only skip those not marked
......
......@@ -719,8 +719,12 @@ static void pull_dump(struct pull_distribution *distribution) {
struct pull_target *u;
for( u=distribution->targets ; u != NULL ; u=u->next ) {
if( u->upgradelist == NULL )
continue;
printf("Updates needed for '%s':\n",u->target->identifier);
upgradelist_dump(u->upgradelist);
upgradelist_free(u->upgradelist);
u->upgradelist = NULL;
}
}
......
......@@ -1460,8 +1460,12 @@ static void updates_dump(struct update_distribution *distribution) {
struct update_target *u;
for( u=distribution->targets ; u != NULL ; u=u->next ) {
if( u->nothingnew )
continue;
printf("Updates needed for '%s':\n",u->target->identifier);
upgradelist_dump(u->upgradelist);
upgradelist_free(u->upgradelist);
u->upgradelist = NULL;
}
}
......
......@@ -386,9 +386,10 @@ static retvalue upgradelist_trypackage(void *data,const char *chunk){
(void)dpkgversions_cmp(version,current->version_in_use,&vcmp);
if( vcmp == 0 ) {
current->version = current->version_in_use;
if( current->deleted )
if( current->deleted ) {
free(current->new_version);
current->new_version = version;
else
} else
free(version);
current->deleted = FALSE;
free(packagename);
......@@ -543,6 +544,8 @@ retvalue upgradelist_install(struct upgradelist *upgrade,const char *dbdir,files
void upgradelist_dump(struct upgradelist *upgrade){
struct package_data *pkg;
assert(upgrade != NULL);
for( pkg = upgrade->list ; pkg != NULL ; pkg = pkg->next ) {
if( pkg->deleted ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment