mysql selector: Fix a memory leak in get_query()
authorAndre <maan@p133.(none)>
Sat, 25 Mar 2006 20:15:46 +0000 (21:15 +0100)
committerAndre <maan@p133.(none)>
Sat, 25 Mar 2006 20:15:46 +0000 (21:15 +0100)
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.

mysql_selector.c

index b51f4f0..c5f71cd 100644 (file)
@@ -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) {