wrc: Remove redundant NULL check before free(). Found by Smatch.

Michael Stefaniuc mstefani at redhat.de
Sat Oct 20 18:14:38 CDT 2007


---
 tools/wrc/parser.y |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/tools/wrc/parser.y b/tools/wrc/parser.y
index 1c4cdaa..0af5330 100644
--- a/tools/wrc/parser.y
+++ b/tools/wrc/parser.y
@@ -1376,16 +1376,16 @@ itemex_options
 		$$->gotid = TRUE;
 		$$->gottype = TRUE;
 		$$->gotstate = TRUE;
-		if($2) free($2);
-		if($4) free($4);
+		free($2);
+		free($4);
 		}
 	| ',' e_expr ',' e_expr ',' expr {
 		$$ = new_itemex_opt($2 ? *($2) : 0, $4 ? *($4) : 0, $6, 0);
 		$$->gotid = TRUE;
 		$$->gottype = TRUE;
 		$$->gotstate = TRUE;
-		if($2) free($2);
-		if($4) free($4);
+		free($2);
+		free($4);
 		}
 	;
 
@@ -1397,23 +1397,23 @@ itemex_p_options
 		}
 	| ',' e_expr ',' expr {
 		$$ = new_itemex_opt($2 ? *($2) : 0, $4, 0, 0);
-		if($2) free($2);
+		free($2);
 		$$->gotid = TRUE;
 		$$->gottype = TRUE;
 		}
 	| ',' e_expr ',' e_expr ',' expr {
 		$$ = new_itemex_opt($2 ? *($2) : 0, $4 ? *($4) : 0, $6, 0);
-		if($2) free($2);
-		if($4) free($4);
+		free($2);
+		free($4);
 		$$->gotid = TRUE;
 		$$->gottype = TRUE;
 		$$->gotstate = TRUE;
 		}
 	| ',' e_expr ',' e_expr ',' e_expr ',' expr {
 		$$ = new_itemex_opt($2 ? *($2) : 0, $4 ? *($4) : 0, $6 ? *($6) : 0, $8);
-		if($2) free($2);
-		if($4) free($4);
-		if($6) free($6);
+		free($2);
+		free($4);
+		free($6);
 		$$->gotid = TRUE;
 		$$->gottype = TRUE;
 		$$->gotstate = TRUE;
-- 
1.5.3.4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20071021/e9785f29/attachment.pgp 


More information about the wine-patches mailing list