From: Tobias Brunner Date: Thu, 27 Aug 2015 12:41:13 +0000 (+0200) Subject: imv-os: Properly free strings for invalid input in pacman X-Git-Tag: 5.3.3rc2~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30ac5c331a7889f0ca3a5bdb7e461d4ae842e82c;p=thirdparty%2Fstrongswan.git imv-os: Properly free strings for invalid input in pacman --- diff --git a/src/libimcv/plugins/imv_os/pacman.c b/src/libimcv/plugins/imv_os/pacman.c index 019e2adb84..088313cd96 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);