jcs
/subtext
/amendments
/190
bile: Sprinkle some paranoia and set frefnum to -1 after FSClose
jcs made amendment 190 over 2 years ago
--- bile.c Thu Jul 7 17:02:07 2022
+++ bile.c Mon Jul 11 21:15:27 2022
@@ -116,6 +116,7 @@ bile_create(const Str255 filename, short vrefnum, cons
create_bail:
FSClose(bile->frefnum);
+ bile->frefnum = -1;
if (bile != NULL)
free(bile);
return NULL;
@@ -193,6 +194,7 @@ bile_open(const Str255 filename, short vrefnum)
open_bail:
FSClose(bile->frefnum);
+ bile->frefnum = -1;
if (bile != NULL)
free(bile);
return NULL;
@@ -259,6 +261,7 @@ bile_close(struct bile *bile)
_bile_error = 0;
FSClose(bile->frefnum);
+ bile->frefnum = -1;
if (bile->map != NULL)
free(bile->map);
}