--- ../src/mwin/winres.c	2010-01-09 18:31:56.000000000 +0100
+++ mwin/winres.c	2010-04-27 15:36:36.000000000 +0200
@@ -139,7 +139,7 @@
 void
 mwFreeInstance(HINSTANCE hInst)
 {
-	free((void *) ((PMWAPPINSTANCE) hInst)->szExecCommand);
+	if (((PMWAPPINSTANCE) hInst)->fResources) fclose (((PMWAPPINSTANCE) hInst)->fResources);
 	free((void *) ((PMWAPPINSTANCE) hInst)->szResFilename);
 	free((void *) ((PMWAPPINSTANCE) hInst));
 }
@@ -328,7 +328,7 @@
 			//  align to dword
 			while ((pos & 3) != 0)
 				pos++;
-			fseek(f, pos, SEEK_SET);
+			if (fseek(f, pos, SEEK_SET)) break;
 		}
 	} while (0);
 

