File tree 1 file changed +14
-12
lines changed
1 file changed +14
-12
lines changed Original file line number Diff line number Diff line change 99
99
HDSLoc *
100
100
dat1FreeLoc ( HDSLoc * locator , int * status ) {
101
101
102
- /* Sanity check */
103
- if ( * status == SAI__OK ){
104
- if ( locator -> prev || locator -> next || locator -> hdsFile ){
105
- * status = DAT__FATAL ;
106
- emsRep ( " " , "Attempt to free HDS locator that is still registered." ,
107
- status );
102
+ /* Do nothing if no locator was supplied */
103
+ if (locator ) {
104
+
105
+ /* Sanity check */
106
+ if ( * status == SAI__OK ){
107
+ if ( locator -> prev || locator -> next || locator -> hdsFile ){
108
+ * status = DAT__FATAL ;
109
+ emsRep ( " " , "Attempt to free HDS locator that is still registered." ,
110
+ status );
111
+ }
108
112
}
109
- }
110
113
111
- /* Always attempt to free the memory even if status
112
- is bad */
113
- if (locator ) {
114
- memset ( locator , 0 , sizeof ( * locator ));
115
- MEM_FREE (locator );
114
+ /* Always attempt to free the memory even if status is bad */
115
+ memset ( locator , 0 , sizeof ( * locator ));
116
+ MEM_FREE (locator );
116
117
}
118
+
117
119
return NULL ;
118
120
}
You can’t perform that action at this time.
0 commit comments