mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-16 18:15:17 +00:00
fix memleak
This commit is contained in:
parent
7065ba251e
commit
d9930744de
@ -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;
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user