aboutsummaryrefslogtreecommitdiff
path: root/Foundation/GTMRegex.m
diff options
context:
space:
mode:
authorGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2009-08-24 15:45:19 +0000
committerGravatar gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3>2009-08-24 15:45:19 +0000
commite6dabdd700a9c4b76e66bb6e7cc8beca3bd1aeeb (patch)
tree4cddedf5d8dcfafa983ca425a44602a2e17c386b /Foundation/GTMRegex.m
parent0f017ffd481523a46e1ef8c14db1e6a1e290ed3b (diff)
[Author: dmaclach]
Standardize how we call free. No need to check for NULL. R=thomasvl DELTA=24 (0 added, 13 deleted, 11 changed)
Diffstat (limited to 'Foundation/GTMRegex.m')
-rw-r--r--Foundation/GTMRegex.m13
1 files changed, 3 insertions, 10 deletions
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];
}