From bc90db46fc34963f87fde66db1c1d358b03875ca Mon Sep 17 00:00:00 2001 From: Tianhua Sun Date: Thu, 4 Jul 2019 09:22:52 +0800 Subject: [PATCH] dm: fix some possible memory leak free memory allocated by strdup() Tracked-On: #3395 Signed-off-by: Tianhua Sun Reviewed-by: Yonghua Huang --- devicemodel/hw/block_if.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devicemodel/hw/block_if.c b/devicemodel/hw/block_if.c index 924ab8fc6..6497825e0 100644 --- a/devicemodel/hw/block_if.c +++ b/devicemodel/hw/block_if.c @@ -662,7 +662,7 @@ blockif_open(const char *optstr, const char *ident) if (size < DEV_BSIZE || (size & (DEV_BSIZE - 1))) { WPRINTF(("%s size not corret, should be multiple of %d\n", nopt, DEV_BSIZE)); - return 0; + goto err; } psectsz = sbuf.st_blksize; }