From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60994) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ab7Xi-0003BV-VK for qemu-devel@nongnu.org; Wed, 02 Mar 2016 09:14:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ab7Xf-0008MN-4B for qemu-devel@nongnu.org; Wed, 02 Mar 2016 09:14:22 -0500 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]:33361) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ab7Xe-0008MD-TP for qemu-devel@nongnu.org; Wed, 02 Mar 2016 09:14:19 -0500 Received: by mail-wm0-x22e.google.com with SMTP id l68so82149244wml.0 for ; Wed, 02 Mar 2016 06:14:18 -0800 (PST) Sender: Paolo Bonzini References: <1456237462-3687-1-git-send-email-kraxel@redhat.com> <1456237462-3687-4-git-send-email-kraxel@redhat.com> From: Paolo Bonzini Message-ID: <56D6F538.4090004@redhat.com> Date: Wed, 2 Mar 2016 15:14:16 +0100 MIME-Version: 1.0 In-Reply-To: <1456237462-3687-4-git-send-email-kraxel@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PULL 3/8] egl-helpers: add functions for render nodes and dma-buf passing List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann , qemu-devel@nongnu.org On 23/02/2016 15:24, Gerd Hoffmann wrote: > + if (strncmp(e->d_name, "renderD", 7)) { > + continue; > + } > + > + r = asprintf(&p, "/dev/dri/%s", e->d_name); > + if (r < 0) { > + return -1; > + } This leaks "dir" (due to skipping the closedir call). Easier to just use g_strdup_printf which ignores the possibility of a malloc failure. Paolo