1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-17 18:45:10 +00:00

Bugfix: memleaks in rss-code

This commit is contained in:
Nikolas Garofil 2010-05-06 17:29:09 +02:00
parent f7980ca5a1
commit 78e9a69b4e
2 changed files with 12 additions and 8 deletions

View File

@ -73,9 +73,9 @@
#include "nc.h"
#endif
#endif
#ifdef BUILD_WEATHER_XOAP
#if defined BUILD_WEATHER_XOAP || defined BUILD_RSS
#include <libxml/parser.h>
#endif /* BUILD_WEATHER_XOAP */
#endif
/* local headers */
#include "core.h"
@ -2477,7 +2477,7 @@ void clean_up_without_threads(void *memtofree1, void* memtofree2) {
#ifdef BUILD_CURL
ccurl_free_info();
#endif
#ifdef RSS
#ifdef BUILD_RSS
rss_free_info();
#endif
#if defined BUILD_WEATHER_METAR || defined BUILD_WEATHER_XOAP
@ -2491,9 +2491,9 @@ void clean_up_without_threads(void *memtofree1, void* memtofree2) {
if (output_methods & TO_X)
cimlib_deinit();
#endif /* BUILD_IMLIB2 */
#ifdef BUILD_WEATHER_XOAP
#if defined BUILD_WEATHER_XOAP || defined BUILD_RSS
xmlCleanupParser();
#endif /* BUILD_WEATHER_XOAP */
#endif
free_specials(specials);

View File

@ -41,11 +41,15 @@ struct rss_data {
unsigned int nrspaces;
};
static ccurl_location_list locations;
static ccurl_location_list locations_rss;
void rss_free_info(void)
{
ccurl_free_locations(locations);
for (ccurl_location_list::iterator i = locations_rss.begin();
i != locations_rss.end(); i++) {
prss_free((PRSS*) (*i)->result);
}
ccurl_free_locations(locations_rss);
}
static void rss_process_info(char *p, int p_max_size, char *uri, char *action, int
@ -54,7 +58,7 @@ static void rss_process_info(char *p, int p_max_size, char *uri, char *action, i
PRSS *data;
char *str;
ccurl_location_ptr curloc = ccurl_find_location(locations, uri);
ccurl_location_ptr curloc = ccurl_find_location(locations_rss, uri);
assert(act_par >= 0 && action);