aboutsummaryrefslogtreecommitdiff
path: root/toys/other/losetup.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2014-10-09 13:43:32 -0500
committerRob Landley <rob@landley.net>2014-10-09 13:43:32 -0500
commit3d56716d362d6a827c5f81029ac64c71b56a2f5c (patch)
tree93377ffa6621214916c82b0985483e4d13822336 /toys/other/losetup.c
parent7196d758a0728bd43451f869eb85528b6cd20bea (diff)
downloadtoybox-3d56716d362d6a827c5f81029ac64c71b56a2f5c.tar.gz
Various bugfixes (mostly resource leaks) from Ashwini Sharma's static analysis, plus occasional tweak by me while reviewing them.
Diffstat (limited to 'toys/other/losetup.c')
-rw-r--r--toys/other/losetup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/other/losetup.c b/toys/other/losetup.c
index e96a125d..e3094ef0 100644
--- a/toys/other/losetup.c
+++ b/toys/other/losetup.c
@@ -86,7 +86,7 @@ static void loopback_setup(char *device, char *file)
// Stat the loop device to see if there's a current association.
memset(loop, 0, sizeof(struct loop_info64));
if (-1 == lfd || ioctl(lfd, LOOP_GET_STATUS64, loop)) {
- if (errno == ENXIO && (flags & (FLAG_a|FLAG_j))) return;
+ if (errno == ENXIO && (flags & (FLAG_a|FLAG_j))) goto done;
if (errno != ENXIO || !file) {
perror_msg("%s", device ? device : "-f");
goto done;