git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix an unitialized pointer in merge-recursive.c
@ 2007-08-16  8:00 Marco Costalba
  2007-08-16  8:08 ` Junio C Hamano
  0 siblings, 1 reply; 7+ messages in thread
From: Marco Costalba @ 2007-08-16  8:00 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Git Mailing List

Indeed &mrtree is passed to merge_trees() that not always
seems to set the value, so on some paths mrtree could
return uninitialized.

Spotted by a gcc 4.2.1 warning

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
---
 merge-recursive.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/merge-recursive.c b/merge-recursive.c
index 16f6a0f..934b0d6 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -1610,7 +1610,7 @@ static int merge(struct commit
 {
  	struct commit_list *iter;
  	struct commit *merged_common_ancestors;
-	struct tree *mrtree;
+	struct tree *mrtree = NULL;
 	int clean;

 	if (show(4)) {
-- 
1.5.3.rc4.67.gf9286

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-08-16 13:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-16  8:00 [PATCH] Fix an unitialized pointer in merge-recursive.c Marco Costalba
2007-08-16  8:08 ` Junio C Hamano
2007-08-16  8:11   ` Marco Costalba
2007-08-16  8:23     ` Junio C Hamano
2007-08-16  8:30       ` Junio C Hamano
2007-08-16  9:07       ` David Kastrup
2007-08-16 13:16       ` Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).