From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yasushi SHOJI Subject: Re: [patch] possible memory leak in diff.c::diff_free_filepair() Date: Sun, 14 Aug 2005 06:09:01 +0900 Message-ID: <877jepo87m.wl@mail2.atmark-techno.com> References: <87y876gl1r.wl@mail2.atmark-techno.com> <7viry9my6k.fsf@assigned-by-dhcp.cox.net> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Cc: git@vger.kernel.org X-From: git-owner@vger.kernel.org Sat Aug 13 23:10:31 2005 Return-path: Received: from vger.kernel.org ([209.132.176.167]) by ciao.gmane.org with esmtp (Exim 4.43) id 1E43Fk-0005qX-Fp for gcvg-git@gmane.org; Sat, 13 Aug 2005 23:09:16 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932288AbVHMVJM (ORCPT ); Sat, 13 Aug 2005 17:09:12 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932290AbVHMVJM (ORCPT ); Sat, 13 Aug 2005 17:09:12 -0400 Received: from shop.atmark-techno.com ([210.191.215.173]:2975 "EHLO mail2.atmark-techno.com") by vger.kernel.org with ESMTP id S932288AbVHMVJM (ORCPT ); Sat, 13 Aug 2005 17:09:12 -0400 Received: from smtp.local-network (dns1.atmark-techno.com [210.191.215.170]) by mail2.atmark-techno.com (Postfix) with ESMTP id 2A1D45EB; Sun, 14 Aug 2005 06:09:10 +0900 (JST) Received: from wat.atmark-techno.com (unknown [192.168.10.81]) by smtp.local-network (Postfix) with ESMTP id 2A3BAB61F; Sun, 14 Aug 2005 06:11:45 +0900 (JST) To: Junio C Hamano In-Reply-To: <7viry9my6k.fsf@assigned-by-dhcp.cox.net> User-Agent: Wanderlust/2.14.0 Sender: git-owner@vger.kernel.org Precedence: bulk X-Mailing-List: git@vger.kernel.org At Sat, 13 Aug 2005 12:30:59 -0700, Junio C Hamano wrote: > > Yasushi SHOJI writes: > > > When I run git-diff-tree on big change, it seems the command eats so > > much memory. so I just put git under valgrind to see what's going on. > > > > diff_free_filespec_data() doesn't free diff_filespec itself. is this > > because in merge_broken() filespec itself is used but fliespec data > > need to be freed? > > Thanks for the patch. I am wondering if the same leak exists in > diff_free_filepair(), which frees the filespec data without > freeing filespec itself for both sides. If this is something > you can trap easily with valgrind I would really appreciate it. oops. probably my english wasn't clear. my patch fixes diff_free_filepair(). the reason I asked about merge_broken() was that those two functions are the only functions calling diff_free_filespec_data(). it's first time reading git source code and still learning ;) -- yashi