From owner-svn-src-head@freebsd.org Fri Jun 23 22:54:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18AB9D8C052; Fri, 23 Jun 2017 22:54:38 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-pf0-f179.google.com (mail-pf0-f179.google.com [209.85.192.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D7DB577C6D; Fri, 23 Jun 2017 22:54:37 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-pf0-f179.google.com with SMTP id e7so29455222pfk.0; Fri, 23 Jun 2017 15:54:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=moIyPzMbiekiLqaZEVp6ux5f42HOdQ5qIuz+v69p6/4=; b=ewJIa5lBjjKTC3nka80ZelWDV+QsgeiR43JTgQB7aSm/iqKXNusWUu8odyNCr8+s0K VlSugnsrRQvJftkHW40G20VFXtzK71OuetKaSsH86MDlDHGwUbb9vfshZrSCTcH2+iNJ eY5fsrNPTOG5rx/mALTsUjA6rM3Y+UXRdoImj7/rRt3t5q19BkoDvGsXTdA9XJSaRouW Yb7eirUWpAIAAd+JQVej81G+kTUDIVzUHX9jQ+9aI6AUNUPteYBPCicNdN9lj1qgPgvm oeiW5xDogJAUgBBrCdmNDbahWkjxMCQqqVeGjlKm+P9+0E72GaBJeCPK/SxdErKRYqVe Smyw== X-Gm-Message-State: AKS2vOyb7BW4t5pFqI2O3Toj+PtvQ7w2EZKbpufnufS6sZjXl09UXELW 9/EqLHU2+hXFse9Nu3I= X-Received: by 10.99.122.13 with SMTP id v13mr10562525pgc.156.1498258476523; Fri, 23 Jun 2017 15:54:36 -0700 (PDT) Received: from mail-pf0-f180.google.com (mail-pf0-f180.google.com. [209.85.192.180]) by smtp.gmail.com with ESMTPSA id n2sm11711710pgd.26.2017.06.23.15.54.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Jun 2017 15:54:36 -0700 (PDT) Received: by mail-pf0-f180.google.com with SMTP id s66so29382738pfs.1; Fri, 23 Jun 2017 15:54:36 -0700 (PDT) X-Received: by 10.99.122.81 with SMTP id j17mr10432117pgn.97.1498258476300; Fri, 23 Jun 2017 15:54:36 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.100.133.66 with HTTP; Fri, 23 Jun 2017 15:54:35 -0700 (PDT) In-Reply-To: <201706231739.v5NHd05x039900@repo.freebsd.org> References: <201706231739.v5NHd05x039900@repo.freebsd.org> From: Conrad Meyer Date: Fri, 23 Jun 2017 15:54:35 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r320277 - head/usr.bin/mkuzip To: Maxim Sobolev Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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: Fri, 23 Jun 2017 22:54:38 -0000 One more nit. On Fri, Jun 23, 2017 at 10:39 AM, Maxim Sobolev wrote: > Author: sobomax > Date: Fri Jun 23 17:39:00 2017 > New Revision: 320277 > URL: https://svnweb.freebsd.org/changeset/base/320277 > > Log: > Don't leak file descriptor in some cases. > > Reported by: cem > MFC after: 6 weeks > > Modified: > head/usr.bin/mkuzip/mkuz_insize.c > > Modified: head/usr.bin/mkuzip/mkuz_insize.c > ============================================================================== > --- head/usr.bin/mkuzip/mkuz_insize.c Fri Jun 23 17:31:07 2017 (r320276) > +++ head/usr.bin/mkuzip/mkuz_insize.c Fri Jun 23 17:39:00 2017 (r320277) > @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > > #include "mkuz_cfg.h" > #include "mkuz_insize.h" > @@ -58,12 +59,15 @@ mkuz_get_insize(struct mkuz_cfg *cfp) > ffd = open(statfsbuf.f_mntfromname, O_RDONLY); > if (ffd < 0) { > warn("open(%s, O_RDONLY)", statfsbuf.f_mntfromname); > + close(ffd); This one is wrong for obvious reasons.