audiod.c: fix memory leak in audiod_status_dump()
authorAndre Noll <maan@systemlinux.org>
Sun, 11 Feb 2007 23:03:25 +0000 (00:03 +0100)
committerAndre Noll <maan@systemlinux.org>
Sun, 11 Feb 2007 23:03:25 +0000 (00:03 +0100)
missing free() for decoder flags. Quite serious: We leaked some bytes on each
status change.

audiod_command.c

index 524fb57dbd7d81cd5cf96923ab7501bff7f1036e..77a0a1ee32bb7a1b3241afc549d999f124a6073e 100644 (file)
@@ -520,6 +520,7 @@ void audiod_status_dump(void)
        old = stat_task->stat_item_values[SI_DECODER_FLAGS];
        new = decoder_flags();
        if (!old || strcmp(old, new)) {
        old = stat_task->stat_item_values[SI_DECODER_FLAGS];
        new = decoder_flags();
        if (!old || strcmp(old, new)) {
+               free(old);
                stat_client_write(new, SI_DECODER_FLAGS);
                stat_task->stat_item_values[SI_DECODER_FLAGS] = new;
        } else
                stat_client_write(new, SI_DECODER_FLAGS);
                stat_task->stat_item_values[SI_DECODER_FLAGS] = new;
        } else