From patchwork Fri Dec 11 03:22:58 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 66416 Received: from hormel.redhat.com (hormel1.redhat.com [209.132.177.33]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nBB3ObgO015624 for ; Fri, 11 Dec 2009 03:24:37 GMT Received: from listman.util.phx.redhat.com (listman.util.phx.redhat.com [10.8.4.110]) by hormel.redhat.com (Postfix) with ESMTP id 237F661B132; Thu, 10 Dec 2009 22:24:37 -0500 (EST) Received: from int-mx01.intmail.prod.int.phx2.redhat.com (nat-pool.util.phx.redhat.com [10.8.5.200]) by listman.util.phx.redhat.com (8.13.1/8.13.1) with ESMTP id nBB3OZRA029771 for ; Thu, 10 Dec 2009 22:24:35 -0500 Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.9]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nBB3OZw6007925 for ; Thu, 10 Dec 2009 22:24:35 -0500 Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBB3OJ3T008768 for ; Thu, 10 Dec 2009 22:24:20 -0500 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) by mx2.suse.de (Postfix) with ESMTP id 639769F4BD for ; Fri, 11 Dec 2009 04:24:19 +0100 (CET) From: NeilBrown To: dm-devel@redhat.com Date: Fri, 11 Dec 2009 14:22:58 +1100 Message-Id: <20091211032413.811950494@suse.de> User-Agent: quilt/0.48-1 References: <20091211032255.766079509@suse.de> Content-Disposition: inline; filename=memory-leak X-RedHat-Spam-Score: -3.979 (AWL,RCVD_IN_DNSWL_MED) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-Scanned-By: MIMEDefang 2.67 on 10.5.110.9 X-loop: dm-devel@redhat.com Subject: [dm-devel] [PATCH libdmraid-events 3/3] Fix minor memory leak in lib_main X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.5 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com --- libdmraid-events.orig/libdmraid-events.c +++ libdmraid-events/libdmraid-events.c @@ -209,7 +209,7 @@ static int lib_main(char op, const char* int lib_argc=3; char *lib_argv[4]; - for(i=0; i<4; i++) + for(i=0; i<3; i++) lib_argv[i]=malloc(strlen(device) + 1); strcpy(lib_argv[0], "dso"); @@ -229,7 +229,7 @@ static int lib_main(char op, const char* libdmraid_exit(lc); } - for(i=0; i<4; i++) + for(i=0; i<3; i++) free(lib_argv[i]); return ret;