diff mbox

[3/6] btrfs-progs: cleanup unnecessary free if malloc fails in btrfs-image

Message ID 1403751186-31559-3-git-send-email-guihc.fnst@cn.fujitsu.com (mailing list archive)
State Accepted
Headers show

Commit Message

Gui Hecheng June 26, 2014, 2:53 a.m. UTC
Don't bother free the buffer if the malloc failed.

Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
---
 btrfs-image.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/btrfs-image.c b/btrfs-image.c
index 7131001..2d482c3 100644
--- a/btrfs-image.c
+++ b/btrfs-image.c
@@ -1631,7 +1631,7 @@  static void *restore_worker(void *data)
 		if (!mdres->error)
 			mdres->error = -ENOMEM;
 		pthread_mutex_unlock(&mdres->mutex);
-		goto out;
+		pthread_exit(NULL);
 	}
 
 	while (1) {