From: Andre Date: Sat, 25 Mar 2006 20:15:46 +0000 (+0100) Subject: mysql selector: Fix a memory leak in get_query() X-Git-Tag: v0.2.12~137 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=9f07bfb31ea556c41b45cdc3f37b6ccccbc8dca0;hp=d4fd7f0255b3fc8c9405dba3b4f5618384c6024b mysql selector: Fix a memory leak in get_query() If the stream definition contained N > 1 "score:" lines (an invalid configuration anyway, there should be at most one), we leaked the first N - 1 score lines. The fix is to take into account the first one only. --- diff --git a/mysql_selector.c b/mysql_selector.c index b51f4f07..c5f71cdd 100644 --- a/mysql_selector.c +++ b/mysql_selector.c @@ -1187,7 +1187,7 @@ static char *get_query(char *streamname, char *filename, int with_path) free(tmp2); continue; } - if (!strcmp(command, "score:")) + if (!score && !strcmp(command, "score:")) score = s_a_r_list(macro_list, arg); } if (!score) {