GUACAMOLE-383: Merge fix for low-impact memory leaks identified by cppcheck.

This commit is contained in:
Michael Jumper 2017-09-23 13:31:01 -07:00
commit c5f674340a
3 changed files with 4 additions and 0 deletions

View File

@ -203,6 +203,7 @@ guacd_config* guacd_conf_load() {
/* Notify of errors preventing reading */ /* Notify of errors preventing reading */
else if (errno != ENOENT) { else if (errno != ENOENT) {
fprintf(stderr, "Unable to open \"" GUACD_CONF_FILE "\": %s\n", strerror(errno)); fprintf(stderr, "Unable to open \"" GUACD_CONF_FILE "\": %s\n", strerror(errno));
free(conf);
return NULL; return NULL;
} }

View File

@ -202,6 +202,7 @@ void guac_rdp_process_cb_data_request(guac_client* client,
default: default:
guac_client_log(client, GUAC_LOG_ERROR, guac_client_log(client, GUAC_LOG_ERROR,
"Server requested unsupported clipboard data type"); "Server requested unsupported clipboard data type");
free(output);
return; return;
} }

View File

@ -280,6 +280,7 @@ guac_terminal_display* guac_terminal_display_alloc(guac_client* client,
font = pango_font_map_load_font(font_map, context, display->font_desc); font = pango_font_map_load_font(font_map, context, display->font_desc);
if (font == NULL) { if (font == NULL) {
guac_client_abort(display->client, GUAC_PROTOCOL_STATUS_SERVER_ERROR, "Unable to get font \"%s\"", font_name); guac_client_abort(display->client, GUAC_PROTOCOL_STATUS_SERVER_ERROR, "Unable to get font \"%s\"", font_name);
free(display);
return NULL; return NULL;
} }
@ -287,6 +288,7 @@ guac_terminal_display* guac_terminal_display_alloc(guac_client* client,
if (metrics == NULL) { if (metrics == NULL) {
guac_client_abort(display->client, GUAC_PROTOCOL_STATUS_SERVER_ERROR, guac_client_abort(display->client, GUAC_PROTOCOL_STATUS_SERVER_ERROR,
"Unable to get font metrics for font \"%s\"", font_name); "Unable to get font metrics for font \"%s\"", font_name);
free(display);
return NULL; return NULL;
} }