int freeRuleExecInfoInternals(ruleExecInfo_t *rs, int freeSpeialStructFlag) { if (rs->msParamArray != NULL && (freeSpeialStructFlag & FREE_MS_PARAM) > 0) { clearMsParamArray (rs->msParamArray, 1); free (rs->msParamArray); } if (rs->doinp != NULL && (freeSpeialStructFlag & FREE_DOINP) > 0) { clearDataObjInp (rs->doinp); free (rs->doinp); } if (rs->doi != NULL) freeAllDataObjInfo(rs->doi); if (rs->rgi != NULL) freeRescGrpInfo(rs->rgi); if (rs->uoic != NULL) freeUserInfo(rs->uoic); if (rs->uoip != NULL) freeUserInfo(rs->uoip); if (rs->coi != NULL) freeCollInfo(rs->coi); #if 0 /* XXXXX deplicate rgio */ if (rs->rgio != NULL) freeRescGrpInfo(rs->rgio); #endif if (rs->uoio != NULL) freeUserInfo(rs->uoio); if (rs->condInputData != NULL) freeKeyValPairStruct(rs->condInputData); if (rs->next != NULL) freeRuleExecInfoStruct(rs->next, freeSpeialStructFlag); return(0); }
int freeL1desc( int l1descInx ) { if ( l1descInx < 3 || l1descInx >= NUM_L1_DESC ) { rodsLog( LOG_NOTICE, "freeL1desc: l1descInx %d out of range", l1descInx ); return SYS_FILE_DESC_OUT_OF_RANGE; } if ( L1desc[l1descInx].dataObjInfo != NULL ) { freeDataObjInfo( L1desc[l1descInx].dataObjInfo ); } if ( L1desc[l1descInx].otherDataObjInfo != NULL ) { freeAllDataObjInfo( L1desc[l1descInx].otherDataObjInfo ); } if ( L1desc[l1descInx].replDataObjInfo != NULL ) { freeDataObjInfo( L1desc[l1descInx].replDataObjInfo ); } if ( L1desc[l1descInx].dataObjInpReplFlag == 1 && L1desc[l1descInx].dataObjInp != NULL ) { clearDataObjInp( L1desc[l1descInx].dataObjInp ); free( L1desc[l1descInx].dataObjInp ); } memset( &L1desc[l1descInx], 0, sizeof( l1desc_t ) ); return 0; }
int freeL1desc (int l1descInx) { if (l1descInx < 3 || l1descInx >= NUM_L1_DESC) { rodsLog (LOG_NOTICE, "freeL1desc: l1descInx %d out of range", l1descInx); return (SYS_FILE_DESC_OUT_OF_RANGE); } if (L1desc[l1descInx].dataObjInfo != NULL) { /* for remote zone type L1desc, rescInfo is not from local cache * but malloc'ed */ if (L1desc[l1descInx].remoteZoneHost != NULL && L1desc[l1descInx].dataObjInfo->rescInfo != NULL) free (L1desc[l1descInx].dataObjInfo->rescInfo); #if 0 /* no longer need this with irsDataObjClose */ /* will be freed in _rsDataObjReplS since it needs the new * replNum and dataID */ if (L1desc[l1descInx].oprType != REPLICATE_DEST) freeDataObjInfo (L1desc[l1descInx].dataObjInfo); #endif if (L1desc[l1descInx].dataObjInfo != NULL) freeDataObjInfo (L1desc[l1descInx].dataObjInfo); } if (L1desc[l1descInx].otherDataObjInfo != NULL) { freeAllDataObjInfo (L1desc[l1descInx].otherDataObjInfo); } if (L1desc[l1descInx].replDataObjInfo != NULL) { freeDataObjInfo (L1desc[l1descInx].replDataObjInfo); } if (L1desc[l1descInx].dataObjInpReplFlag == 1 && L1desc[l1descInx].dataObjInp != NULL) { clearDataObjInp (L1desc[l1descInx].dataObjInp); free (L1desc[l1descInx].dataObjInp); } memset (&L1desc[l1descInx], 0, sizeof (l1desc_t)); return (0); }