svn commit: trunk/busybox/util-linux

vda at busybox.net vda at busybox.net
Sun Nov 19 17:34:58 UTC 2006


Author: vda
Date: 2006-11-19 09:34:57 -0800 (Sun, 19 Nov 2006)
New Revision: 16585

Log:
mount: if FILE* is NULL, it's not wise to use it.


Modified:
   trunk/busybox/util-linux/mount.c


Changeset:
Modified: trunk/busybox/util-linux/mount.c
===================================================================
--- trunk/busybox/util-linux/mount.c	2006-11-19 17:33:54 UTC (rev 16584)
+++ trunk/busybox/util-linux/mount.c	2006-11-19 17:34:57 UTC (rev 16585)
@@ -261,14 +261,16 @@
 
 	/* If the mount was successful, and we're maintaining an old-style
 	 * mtab file by hand, add the new entry to it now. */
-mtab:
+ mtab:
 	if (ENABLE_FEATURE_MTAB_SUPPORT && useMtab && !rc && !(vfsflags & MS_REMOUNT)) {
 		char *fsname;
 		FILE *mountTable = setmntent(bb_path_mtab_file, "a+");
 		int i;
 
-		if (!mountTable)
+		if (!mountTable) {
 			bb_error_msg("no %s",bb_path_mtab_file);
+			goto ret;
+		}
 
 		// Add vfs string flags
 
@@ -300,7 +302,7 @@
 			free(fsname);
 		}
 	}
-
+ ret:
 	return rc;
 }
 




More information about the busybox-cvs mailing list