From owner-svn-src-head@FreeBSD.ORG Wed Jan 16 17:48:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3F4CEBC5 for ; Wed, 16 Jan 2013 17:48:24 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com [209.85.215.48]) by mx1.freebsd.org (Postfix) with ESMTP id BDD9BDD5 for ; Wed, 16 Jan 2013 17:48:23 +0000 (UTC) Received: by mail-la0-f48.google.com with SMTP id ej20so1697433lab.7 for ; Wed, 16 Jan 2013 09:48:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=kjEH5x/zIp3U6wOR+d2W8zqX44EDt75L0hz8m9fUcKk=; b=DJAYmILR6wbgQvpH9I/5edSAER/mttcyhGn2TJVA0Yz7dirBlh4xG4yJT+7fBiPHRV WAnGzzN3150aS90VCZwUGcSUyvDrY9QuC5kKA1oLwHAj7peyAzQN47UEAFU64Fv6xVY4 wTtt8rZTgGnJjzLxZp+ylZuJdHLVmuW1sio7A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=kjEH5x/zIp3U6wOR+d2W8zqX44EDt75L0hz8m9fUcKk=; b=DTzh+5QRysEsP28iYiu9ndnMC4VcrXphy8F8ZAO5PjZnhu3i2PIHX8a3vOV1fAKYN+ cZZqZOkoFE1RbOwk6GNnJffw4dMyfZni9TSXOkFuWabFPNTxrxS8rc2IF/hMhJPDPjTm oU7a0nWgaSnoiVDRmRuiWXFDzWRV/xA0f7MIyl/fFjL0tgLir8CSzF7pxSwD8KqhDPUa NTKUG1DkGBJ/+bqQXFYHRHfbAZKXGELg3TWZLjIiEO68hYzbygc/AfxmTBTiu6zgZGeE DKToOG9voFzdZegIBvQWRpGCyKg7EU1FaopMHRPDDjFLYjIp8eWX0L4jNIP1zV87vLKJ x8sg== X-Received: by 10.112.23.34 with SMTP id j2mr983712lbf.118.1358358502201; Wed, 16 Jan 2013 09:48:22 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.30.131 with HTTP; Wed, 16 Jan 2013 09:47:52 -0800 (PST) In-Reply-To: References: <201301160503.r0G53qie087155@svn.freebsd.org> From: Eitan Adler Date: Wed, 16 Jan 2013 12:47:52 -0500 X-Google-Sender-Auth: nZcsX6vBtiXI6dGkt3yM4KjVrpk Message-ID: Subject: Re: svn commit: r245494 - head/bin/pwait To: Xin LI Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQlMDy3WUMO37tRgRQY07FP3d9xRhaeQSxpAo3m8r5ohaKQYFYBPh70vQ626ip2WoKBEbZIA Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jan 2013 17:48:24 -0000 On 16 January 2013 01:49, Xin LI wrote: > This doesn't seem right -- you should never release memory before exit, > especially for memory allocated in main(), unless this "main" is intended > for different purpose like a monolithic shell that wants to avoid exec(). > Note that pwait(1) have multiple exit points I don't think it's practical. ... There have been multiple conversations about this: on hackers, on the commit lists, and on the clang analyzer lists. I don't care much how the final code looks: with either free or return but please make sure that scan-build finds no warnings. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams