xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] xl: free config_data on error in domain_create
@ 2016-02-17 14:04 Ian Campbell
  2016-02-17 14:04 ` [PATCH 2/3] xl: use xrealloc in domain create Ian Campbell
  2016-02-19 16:02 ` [PATCH 1/3] xl: free config_data on error in domain_create Ian Jackson
  0 siblings, 2 replies; 8+ messages in thread
From: Ian Campbell @ 2016-02-17 14:04 UTC (permalink / raw)
  To: ian.jackson, wei.liu2, xen-devel; +Cc: Ian Campbell

CID: 1055898

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/xl_cmdimpl.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index d5a397a..e819ee6 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 */
@@ -6525,6 +6526,7 @@ int main_networkattach(int argc, char **argv)
     }
 
     xlu_cfg_destroy(config);
+    config = NULL;
 
     if (argc > 0) return 1; /* Parse error above */
 
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-02-19 16:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-17 14:04 [PATCH 1/3] xl: free config_data on error in domain_create Ian Campbell
2016-02-17 14:04 ` [PATCH 2/3] xl: use xrealloc in domain create Ian Campbell
2016-02-17 14:04   ` [PATCH 3/3] xl: create: close restore_fd_to_close on error Ian Campbell
2016-02-19 16:04     ` Ian Jackson
2016-02-19 16:03   ` [PATCH 2/3] xl: use xrealloc in domain create Ian Jackson
2016-02-19 16:02 ` [PATCH 1/3] xl: free config_data on error in domain_create Ian Jackson
2016-02-19 16:08   ` Ian Campbell
2016-02-19 16:10     ` Ian Campbell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).