imv-os: Properly free strings for invalid input in pacman

This commit is contained in:
Tobias Brunner 2015-08-27 14:41:13 +02:00
parent e3e208fb9f
commit 30ac5c331a
1 changed files with 11 additions and 0 deletions

View File

@ -396,6 +396,17 @@ static void process_packages(char *filename, char *product, bool security)
pacman_state = PACMAN_STATE_BEGIN_PACKAGE;
}
}
switch (pacman_state)
{
case PACMAN_STATE_END_PACKAGE:
free(version);
/* fall-through */
case PACMAN_STATE_VERSION:
free(package);
break;
default:
break;
}
fclose(file);
db->destroy(db);