]> 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 c0632c24d2e770da657e4db35dc0c55f90803a83..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) {
@@ -647,7 +653,7 @@ static char *database_dir;
 static void close_afs_tables(void)
 {
        int i;
-       PARA_NOTICE_LOG("closing afs_tables\n");
+       PARA_NOTICE_LOG("closing afs tables\n");
        for (i = 0; i < NUM_AFS_TABLES; i++)
                afs_tables[i].close();
        free(database_dir);