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

fix memleak

This commit is contained in:
Nikolas Garofil 2010-04-18 20:49:14 +02:00
parent 7065ba251e
commit d9930744de
2 changed files with 3 additions and 1 deletions

View File

@ -2635,7 +2635,7 @@ static void set_default_configurations(void)
mysql_settings.port = 0;
mysql_settings.user = NULL;
mysql_settings.password = NULL;
mysql_settings.db = strdup("mysql");
mysql_settings.db = NULL;
#endif /* BUILD_MYSQL */
#ifdef BUILD_XMMS2
info.xmms2.artist = NULL;

View File

@ -36,6 +36,8 @@ struct mysql_conn mysql_settings;
void print_mysql(struct text_object *obj, char *p, int p_max_size) {
MYSQL *conn = mysql_init(NULL);
if(mysql_settings.db == NULL)
mysql_settings.db = strdup("mysql");
if(conn == NULL) {
NORM_ERR("Can't initialize MySQL");
mysql_library_end();