diff options
author | Michael Schroeder <mls@suse.de> | 2013-12-10 16:15:38 +0100 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2013-12-10 16:15:38 +0100 |
commit | d66d76bdde309536289f4a755ee327c1e92b2fc4 (patch) | |
tree | ef180320c1a591531d42aeae13861199e49985ef /src/pool.c | |
parent | 60cb663d7567796f17d4218757ea087ed690e4b2 (diff) | |
download | libsolv-d66d76bdde309536289f4a755ee327c1e92b2fc4.tar.gz libsolv-d66d76bdde309536289f4a755ee327c1e92b2fc4.tar.bz2 libsolv-d66d76bdde309536289f4a755ee327c1e92b2fc4.zip |
fix double-free if the number of languages is reduced to zero
Diffstat (limited to 'src/pool.c')
-rw-r--r-- | src/pool.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -1661,12 +1661,9 @@ pool_set_languages(Pool *pool, const char **languages, int nlanguages) pool->languagecache = solv_free(pool->languagecache); pool->languagecacheother = 0; - if (pool->nlanguages) - { - for (i = 0; i < pool->nlanguages; i++) - free((char *)pool->languages[i]); - free(pool->languages); - } + for (i = 0; i < pool->nlanguages; i++) + free((char *)pool->languages[i]); + pool->languages = solv_free(pool->languages); pool->nlanguages = nlanguages; if (!nlanguages) return; |