Message ID | 3fbdb06d-e897-72da-14c9-89ed680e070f@huawei.com |
---|---|
State | Superseded |
Headers | show |
Series | e2fsprogs: some bugfixs and some code cleanups | expand |
diff --git a/misc/mke2fs.c b/misc/mke2fs.c index afbcf486..2f229534 100644 --- a/misc/mke2fs.c +++ b/misc/mke2fs.c @@ -585,8 +585,10 @@ static void zap_sector(ext2_filsys fs, int sect, int nsect) else { magic = (unsigned int *) (buf + BSD_LABEL_OFFSET); if ((*magic == BSD_DISKMAGIC) || - (*magic == BSD_MAGICDISK)) + (*magic == BSD_MAGICDISK)) { + free(buf); return; + } } }