X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=afs.c;h=522615a31b742f937a814a7f53f9708339033ac4;hb=425bd709b2df8dc2754678ca28c91b1534d26078;hp=c0632c24d2e770da657e4db35dc0c55f90803a83;hpb=03b4e39aad5a87e70306127157c65f87ac6498d9;p=paraslash.git diff --git a/afs.c b/afs.c index c0632c24..522615a3 100644 --- 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);