aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--DebugUtils/GTMMethodCheck.m8
-rw-r--r--Foundation/GTMLoggerRingBufferWriter.m4
-rw-r--r--Foundation/GTMRegex.m13
-rw-r--r--Foundation/GTMStackTrace.m10
4 files changed, 11 insertions, 24 deletions
diff --git a/DebugUtils/GTMMethodCheck.m b/DebugUtils/GTMMethodCheck.m
index a8c4ae3..0d55e11 100644
--- a/DebugUtils/GTMMethodCheck.m
+++ b/DebugUtils/GTMMethodCheck.m
@@ -151,13 +151,9 @@ void GTMMethodCheckMethodChecker(void) {
}
}
}
- if (methods) {
- free(methods);
- }
- }
- if (classes) {
- free(classes);
+ free(methods);
}
+ free(classes);
[pool release];
}
diff --git a/Foundation/GTMLoggerRingBufferWriter.m b/Foundation/GTMLoggerRingBufferWriter.m
index 4a8c7c6..9d1c63f 100644
--- a/Foundation/GTMLoggerRingBufferWriter.m
+++ b/Foundation/GTMLoggerRingBufferWriter.m
@@ -88,9 +88,7 @@ typedef void (GTMRingBufferPairCallback)(GTMLoggerRingBufferWriter *rbw,
[self reset];
[writer_ release];
- if (buffer_) {
- free(buffer_);
- }
+ free(buffer_);
[super dealloc];
diff --git a/Foundation/GTMRegex.m b/Foundation/GTMRegex.m
index 1027224..4c393a6 100644
--- a/Foundation/GTMRegex.m
+++ b/Foundation/GTMRegex.m
@@ -514,10 +514,7 @@ static NSString *const kReplacementPattern =
// Don't need a finalize because savedRegMatches_ is marked __strong
- (void)dealloc {
- if (savedRegMatches_) {
- free(savedRegMatches_);
- savedRegMatches_ = nil;
- }
+ free(savedRegMatches_);
[regex_ release];
[utf8StrBuf_ release];
[super dealloc];
@@ -656,8 +653,7 @@ static NSString *const kReplacementPattern =
} @catch (id e) { // COV_NF_START - no real way to force this in a test
_GTMDevLog(@"Exceptions while trying to advance enumeration (%@)", e);
// if we still have something in our temp, free it
- if (nextMatches)
- free(nextMatches);
+ free(nextMatches);
} // COV_NF_END
return result;
@@ -685,10 +681,7 @@ static NSString *const kReplacementPattern =
}
- (void)dealloc {
- if (regMatches_) {
- free(regMatches_);
- regMatches_ = nil;
- }
+ free(regMatches_);
[utf8StrBuf_ release];
[super dealloc];
}
diff --git a/Foundation/GTMStackTrace.m b/Foundation/GTMStackTrace.m
index 05843b5..1c7bafb 100644
--- a/Foundation/GTMStackTrace.m
+++ b/Foundation/GTMStackTrace.m
@@ -261,7 +261,7 @@ NSUInteger GTMGetStackAddressDescriptors(struct GTMAddressDescriptor outDescs[],
// Fill in the desc structures
result = GTMGetStackAddressDescriptorsForAddresses(pcs, outDescs, addrCount);
}
- if (pcs) free(pcs);
+ free(pcs);
}
#endif // MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
@@ -316,8 +316,8 @@ NSString *GTMStackTrace(void) {
(count - kTracesToStrip));
}
}
- if (pcs) free(pcs);
- if (descs) free(descs);
+ free(pcs);
+ free(descs);
}
#endif // MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
@@ -348,8 +348,8 @@ NSString *GTMStackTraceFromException(NSException *e) {
// Build the trace
trace = GTMStackTraceFromAddressDescriptors(descs, count);
}
- if (pcs) free(pcs);
- if (descs) free(descs);
+ free(pcs);
+ free(descs);
}
return trace;