From 176ff96a26c08c2adc3ee1b3772d9ad11cee736e Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Thu, 17 Mar 2016 15:54:15 -0700 Subject: [PATCH] GUAC-1164: Ensure elements of SVC names array are freed. --- src/protocols/rdp/rdp_settings.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/protocols/rdp/rdp_settings.c b/src/protocols/rdp/rdp_settings.c index 133da61e..dddae74b 100644 --- a/src/protocols/rdp/rdp_settings.c +++ b/src/protocols/rdp/rdp_settings.c @@ -765,7 +765,19 @@ void guac_rdp_settings_free(guac_rdp_settings* settings) { free(settings->username); /* Free channel name array */ - free(settings->svc_names); + if (settings->svc_names != NULL) { + + /* Free all elements of array */ + char** current = &(settings->svc_names[0]); + while (*current != NULL) { + free(*current); + current++; + } + + /* Free array itself */ + free(settings->svc_names); + + } #ifdef ENABLE_COMMON_SSH /* Free SFTP settings */