diff options
| author | Tobias Brunner <tobias@strongswan.org> | 2015-08-27 14:41:13 +0200 |
|---|---|---|
| committer | Tobias Brunner <tobias@strongswan.org> | 2015-08-27 14:42:05 +0200 |
| commit | 30ac5c331a7889f0ca3a5bdb7e461d4ae842e82c (patch) | |
| tree | 4bb7a52634c736cfc613b606ffb9bb51573f16af /src/libimcv/plugins | |
| parent | e3e208fb9f2adc5bf47353708ef53199a0f85db6 (diff) | |
| download | strongswan-30ac5c331a7889f0ca3a5bdb7e461d4ae842e82c.tar.bz2 strongswan-30ac5c331a7889f0ca3a5bdb7e461d4ae842e82c.tar.xz | |
imv-os: Properly free strings for invalid input in pacman
Diffstat (limited to 'src/libimcv/plugins')
| -rw-r--r-- | src/libimcv/plugins/imv_os/pacman.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libimcv/plugins/imv_os/pacman.c b/src/libimcv/plugins/imv_os/pacman.c index 019e2adb8..088313cd9 100644 --- a/src/libimcv/plugins/imv_os/pacman.c +++ b/src/libimcv/plugins/imv_os/pacman.c @@ -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); |
