summary refs log tree commit diff stats
path: root/plugins/mpcinfo/theme.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/mpcinfo/theme.c')
-rw-r--r--plugins/mpcinfo/theme.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/plugins/mpcinfo/theme.c b/plugins/mpcinfo/theme.c
index 3d8a7a0e..7b92ec08 100644
--- a/plugins/mpcinfo/theme.c
+++ b/plugins/mpcinfo/theme.c
@@ -91,13 +91,15 @@ struct theme themeAdd(struct theme data, char *info){
 }
 
 void loadThemes(){
-    char *hDir, *hFile, *line, *val;
+    char *hDir, *hFile, *line, *lineCap, *val;
 	FILE *f;
 	hexchat_print(ph,"loading themes\n");
     hDir=(char*)calloc(1024,sizeof(char));
     strcpy(hDir,hexchat_get_info(ph,"configdir"));
     hFile=str3cat(hDir,"\\","mpcInfo.theme.txt");
     f = fopen(hFile,"r");
+    free(hDir);
+    free(hFile);
     if(f==NULL)
 	{
 		hexchat_print(ph,"no theme in homedir, checking global theme");
@@ -120,10 +122,12 @@ void loadThemes(){
 			val=split(line,'=');
 			printf("line: %s\n",line);
 			printf("val: %s\n",val);
-			if (strcmp(toUpper(line),"OFF_LINE")==0) notRunTheme=themeAdd(notRunTheme,val);
-			if (strcmp(toUpper(line),"TITLE_LINE")==0) titleTheme=themeAdd(titleTheme,val);
-			if (strcmp(toUpper(line),"MP3_LINE")==0) mp3Theme=themeAdd(mp3Theme,val);
-			if (strcmp(toUpper(line),"OGG_LINE")==0) mp3Theme=themeAdd(oggTheme,val);
+			lineCap=toUpper(line);
+			if (strcmp(lineCap,"OFF_LINE")==0) notRunTheme=themeAdd(notRunTheme,val);
+			if (strcmp(lineCap,"TITLE_LINE")==0) titleTheme=themeAdd(titleTheme,val);
+			if (strcmp(lineCap,"MP3_LINE")==0) mp3Theme=themeAdd(mp3Theme,val);
+			if (strcmp(lineCap,"OGG_LINE")==0) mp3Theme=themeAdd(oggTheme,val);
+			free(lineCap);
 		}
 		fclose(f);
 		hexchat_print(ph, "theme loaded successfull\n");