]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - afs.c
afs.c: Improve documentation of activate_mood_or_playlist().
[paraslash.git] / afs.c
diff --git a/afs.c b/afs.c
index 031a00993ffec086a1fe447fb6d4f1bc528234fd..522615a31b742f937a814a7f53f9708339033ac4 100644 (file)
--- a/afs.c
+++ b/afs.c
@@ -481,6 +481,12 @@ static int activate_mood_or_playlist(const char *arg, int *num_admissible,
        if (num_admissible)
                *num_admissible = ret;
        current_play_mode = mode;
+       /*
+        * We get called with arg == current_mop from the signal dispatcher
+        * after SIGHUP and from the error path of the select command to
+        * re-select the current mood or playlist. In this case the assignment
+        * to current_mop below would result in a use-after-free condition.
+        */
        if (arg != current_mop) {
                free(current_mop);
                if (arg) {