directory_save: free directory on error

Fix a minor memory leak in the error handler.
This commit is contained in:
Max Kellermann 2009-11-01 15:34:13 +01:00
parent 2cd8a9fecf
commit 10b7608926

View File

@ -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;
}