diff options
author | Max Kellermann <max@duempel.org> | 2009-11-01 15:34:13 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-11-01 15:34:13 +0100 |
commit | 10b760892602d8ddb7c413d5f91f990daf8a4dca (patch) | |
tree | 36d7a9e0737d2546c2b9c65435dfe7f047e247e8 /src/directory_save.c | |
parent | 2cd8a9fecf197a795ae5941badd1ce854d53ab98 (diff) | |
download | mpd-10b760892602d8ddb7c413d5f91f990daf8a4dca.tar.gz mpd-10b760892602d8ddb7c413d5f91f990daf8a4dca.tar.xz mpd-10b760892602d8ddb7c413d5f91f990daf8a4dca.zip |
directory_save: free directory on error
Fix a minor memory leak in the error handler.
Diffstat (limited to 'src/directory_save.c')
-rw-r--r-- | src/directory_save.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/directory_save.c b/src/directory_save.c index 9d6933d63..d301d168b 100644 --- a/src/directory_save.c +++ b/src/directory_save.c @@ -128,8 +128,10 @@ directory_load_subdir(FILE *fp, struct directory *parent, const char *name, directory = directory_new(name, parent); success = directory_load(fp, directory, error_r); - if (!success) + if (!success) { + directory_free(directory); return NULL; + } return directory; } |