Whamcloud - gitweb
git://git.whamcloud.com
/
tools
/
e2fsprogs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Set pointer to NULL after ext2fs_free
[tools/e2fsprogs.git]
/
lib
/
ext2fs
/
openfs.c
diff --git
a/lib/ext2fs/openfs.c
b/lib/ext2fs/openfs.c
index
8035755
..
a1a3517
100644
(file)
--- a/
lib/ext2fs/openfs.c
+++ b/
lib/ext2fs/openfs.c
@@
-450,10
+450,11
@@
errcode_t ext2fs_open2(const char *name, const char *io_options,
return 0;
cleanup:
- if (flags & EXT2_FLAG_NOFREE_ON_ERROR)
- *ret_fs = fs;
- else
+ if (!(flags & EXT2_FLAG_NOFREE_ON_ERROR)) {
ext2fs_free(fs);
+ fs = NULL;
+ }
+ *ret_fs = fs;
return retval;
}