From: Ian Campbell Subject: [PATCH v2 2/2] xl: free config_data on error in domain_create Date: Tue, 23 Feb 2016 10:32:54 +0000 Message-ID: <1456223574-1594-2-git-send-email-ian.campbell@citrix.com> References: <1456223574-1594-1-git-send-email-ian.campbell@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1456223574-1594-1-git-send-email-ian.campbell@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: ian.jackson@eu.citrix.com, wei.liu2@citrix.com, xen-devel@lists.xen.org Cc: Ian Campbell List-Id: xen-devel@lists.xenproject.org CID: 1055898 Signed-off-by: Ian Campbell --- v2: Move spurious looking NULL assignment to previous patch where it belongs. --- tools/libxl/xl_cmdimpl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 9f08f64..514f5a8 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -2795,6 +2795,7 @@ static uint32_t create_domain(struct domain_create *dom_info) if (!restoring && extra_config && strlen(extra_config)) { if (config_len > INT_MAX - (strlen(extra_config) + 2 + 1)) { fprintf(stderr, "Failed to attach extra configuration\n"); + free(config_data); return ERROR_FAIL; } /* allocate space for the extra config plus two EOLs plus \0 */ -- 2.1.4