directory_save: free directory on error
Fix a minor memory leak in the error handler.
This commit is contained in:
parent
2cd8a9fecf
commit
10b7608926
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user