]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - mood.c
afs: Fix memory leak in mood_load().
[paraslash.git] / mood.c
diff --git a/mood.c b/mood.c
index 9cdfd011a6ef4f2ab9fb180892f6412247eb68fe..e85cf36a35b9e533370bddd95c5c5db74a214e85 100644 (file)
--- a/mood.c
+++ b/mood.c
@@ -630,9 +630,10 @@ int mood_load(const char *mood_name, char **msg)
        ret = aa.m->stats.num;
        mood_unload();
        current_mood = aa.m;
+       ret = 1;
 out:
        free(aa.array);
-       if (ret < 0)
+       if (ret <= 0) /* error, or no admissible files */
                destroy_mood(aa.m);
        return ret;
 }