diff --git a/client/config.c b/client/config.c index 13845ee2..5c042ace 100644 --- a/client/config.c +++ b/client/config.c @@ -533,8 +533,6 @@ TDNFReadConfFilesFromDir( { continue; } - dwError = TDNFAllocateStringPrintf(&pszFile, pszDir, pEnt->d_name); - BAIL_ON_TDNF_ERROR(dwError); dwError = TDNFJoinPath(&pszFile, pszDir, pEnt->d_name, NULL); BAIL_ON_TDNF_ERROR(dwError); diff --git a/client/goal.c b/client/goal.c index 473873a8..62b79f9e 100644 --- a/client/goal.c +++ b/client/goal.c @@ -675,6 +675,7 @@ TDNFMarkAutoInstalled( { fclose(fp); } + TDNF_SAFE_FREE_MEMORY(pszDataDir); TDNF_SAFE_FREE_MEMORY(pszAutoFile); TDNF_SAFE_FREE_STRINGARRAY(ppszAutoInstalled); return dwError; @@ -958,7 +959,11 @@ TDNFSolvAddMinVersions( map_setall(pPool->considered); map_subtract(pPool->considered, pMapMinVersions); cleanup: - TDNFFreeMemory(pMapMinVersions); + if(pMapMinVersions) + { + map_free(pMapMinVersions); + TDNFFreeMemory(pMapMinVersions); + } TDNF_SAFE_FREE_MEMORY(pszTmp); TDNF_SAFE_FREE_STRINGARRAY(ppszTokens); return dwError; diff --git a/pytests/tests/test_erase.py b/pytests/tests/test_erase.py index 26872d42..8d69bc07 100644 --- a/pytests/tests/test_erase.py +++ b/pytests/tests/test_erase.py @@ -44,3 +44,11 @@ def test_erase_package_without_version_suffix(utils): utils.run(['tdnf', 'erase', '-y', pkgname]) assert(not utils.check_package(pkgname)) + + +def test_erase_memcheck(utils): + pkgname = utils.config["mulversion_pkgname"] + utils.install_package(pkgname) + + utils.run_memcheck(['tdnf', 'erase', '-y', pkgname]) + assert(not utils.check_package(pkgname)) diff --git a/pytests/tests/test_install.py b/pytests/tests/test_install.py index 35fc1287..72753eae 100644 --- a/pytests/tests/test_install.py +++ b/pytests/tests/test_install.py @@ -59,3 +59,11 @@ def test_dummy_requires(utils): pkg = utils.config["dummy_requires_pkgname"] ret = utils.run(['tdnf', 'install', '-y', pkg]) assert ' nothing provides ' in ret['stderr'][0] + + +def test_install_memcheck(utils): + pkgname = utils.config["mulversion_pkgname"] + utils.erase_package(pkgname) + + utils.run_memcheck(['tdnf', 'install', '-y', '--nogpgcheck', pkgname]) + assert(utils.check_package(pkgname)) diff --git a/solv/tdnfpool.c b/solv/tdnfpool.c index b9f90374..ec87897e 100644 --- a/solv/tdnfpool.c +++ b/solv/tdnfpool.c @@ -48,6 +48,12 @@ SolvFreeSack( Pool* pPool = pSack->pPool; if(pPool) { + if (pPool->considered) + { + /* shouldn't this be owned by pPool? */ + map_free(pPool->considered); + TDNF_SAFE_FREE_MEMORY(pPool->considered); + } pool_free(pPool); } TDNF_SAFE_FREE_MEMORY(pSack->pszCacheDir);