From owner-freebsd-bugs@FreeBSD.ORG Fri Sep 26 19:12:43 2014 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 42506879 for ; Fri, 26 Sep 2014 19:12:43 +0000 (UTC) Received: from mail-qg0-x22f.google.com (mail-qg0-x22f.google.com [IPv6:2607:f8b0:400d:c04::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 057D28E5 for ; Fri, 26 Sep 2014 19:12:42 +0000 (UTC) Received: by mail-qg0-f47.google.com with SMTP id z107so9511337qgd.6 for ; Fri, 26 Sep 2014 12:12:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=6UpY/QlSeinZZJO1JEp+bcAoui3qCsUs1JxXR6LQFPg=; b=hPsuRTUZDjl3KO+SJp1ba+R7nuyadMczC+BqoYBBFPLB1g8VUUFkls4qA7ofD7TpXp bZrJ+nkQuH0rvd1oL71aK3XdRvbYmEdpzpZa+OxolV3CCA4XgYIhakXnPfoNPRPGGTnt g889Pf6orsYpq/PslElyE+GjVGOSj9zgbr1Ny6q4/iO8uhiKN9NL2/UNOUmvrNfFd0za UZMRB2X9apxitxH9CcGjJtjgN2afTBs0V/wz1FBFOWG5d+0uEeTL3QUbxuWhL2bD+oJA 6Ci9Jn0Ozg/nIH5qu1bEDOmZgfi2HA/DBYPaPInfFG84OcIwaV6T7wjvppVXiufISQvm XyHw== MIME-Version: 1.0 X-Received: by 10.140.104.68 with SMTP id z62mr35314651qge.81.1411758761835; Fri, 26 Sep 2014 12:12:41 -0700 (PDT) Sender: hiren.panchasara@gmail.com Received: by 10.96.168.194 with HTTP; Fri, 26 Sep 2014 12:12:41 -0700 (PDT) In-Reply-To: <54059C2C.9090204@gmail.com> References: <54059C2C.9090204@gmail.com> Date: Fri, 26 Sep 2014 12:12:41 -0700 X-Google-Sender-Auth: IKHRjttrLNy_H7hW4R9LYURTBYo Message-ID: Subject: Re: libutil: pidfile_ functions may cause leaks From: hiren panchasara To: Kal Content-Type: text/plain; charset=UTF-8 Cc: freebsd-bugs@freebsd.org X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Sep 2014 19:12:43 -0000 On Tue, Sep 2, 2014 at 3:30 AM, Kal wrote: > Hi, > If pidfile_write fails calling ftruncate or pwrite then pfh->pf_fd is > set to -1. This will cause pidfile_close and pidfile_remove to both > error out without actually freeing the pfh pointer. I have attached a > patch which will make pidfile_close and pidfile_remove always cause pfh > to be freed. > Thanks! Thank you for your patch. Can you please throw this into a bugzilla ticket so it doesn't get lost? https://bugs.freebsd.org/bugzilla/ cheers, Hiren