diff options
author | Antenore Gatta <antenore@simbiosi.org> | 2019-09-27 12:54:22 +0300 |
---|---|---|
committer | Antenore Gatta <antenore@simbiosi.org> | 2019-09-27 12:54:22 +0300 |
commit | f1ad12a028c1bb1b66fb737482109daebd556fb1 (patch) | |
tree | 3a3abf24ad1da08c742c8cad326e38af0d395917 /plugins | |
parent | 96f4969fc9294faf23f607177928262ef989e0c3 (diff) |
Fixing memory resources deallocation
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/rdp/rdp_plugin.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/plugins/rdp/rdp_plugin.c b/plugins/rdp/rdp_plugin.c index 92b966854..5d66eb04f 100644 --- a/plugins/rdp/rdp_plugin.c +++ b/plugins/rdp/rdp_plugin.c @@ -864,9 +864,7 @@ int remmina_rdp_set_printers(void *user_data, unsigned flags, cups_dest_t *dest) const gchar *s = remmina_plugin_service->file_get_string(remminafile, "printer_overrides"); RDPDR_PRINTER* printer; - //printer = (RDPDR_PRINTER*) calloc(1, sizeof(RDPDR_PRINTER)); - printer = (RDPDR_PRINTER*) malloc(sizeof(RDPDR_PRINTER)); - ZeroMemory(printer, sizeof(RDPDR_PRINTER)); + printer = (RDPDR_PRINTER*) calloc(1, sizeof(RDPDR_PRINTER)); printer->Type = RDPDR_DTYP_PRINT; g_debug("Printer Type: %d", printer->Type); @@ -1261,8 +1259,7 @@ static gboolean remmina_rdp_main(RemminaProtocolWidget* gp) RDPDR_DRIVE* drive; gsize sz; - drive = (RDPDR_DRIVE*)malloc(sizeof(RDPDR_DRIVE)); - ZeroMemory(drive, sizeof(RDPDR_DRIVE)); + drive = (RDPDR_DRIVE*) calloc(1, sizeof(RDPDR_DRIVE)); rfi->settings->DeviceRedirection = TRUE; remmina_rdp_load_static_channel_addin(channels, rfi->settings, "rdpdr", rfi->settings); @@ -1298,8 +1295,7 @@ static gboolean remmina_rdp_main(RemminaProtocolWidget* gp) if (remmina_plugin_service->file_get_int(remminafile, "sharesmartcard", FALSE)) { RDPDR_SMARTCARD* smartcard; - smartcard = (RDPDR_SMARTCARD*)malloc(sizeof(RDPDR_SMARTCARD)); - ZeroMemory(smartcard, sizeof(RDPDR_SMARTCARD)); + smartcard = (RDPDR_SMARTCARD*) calloc(1, sizeof(RDPDR_SMARTCARD)); smartcard->Type = RDPDR_DTYP_SMARTCARD; @@ -1325,8 +1321,7 @@ static gboolean remmina_rdp_main(RemminaProtocolWidget* gp) /* /serial[:<name>[,<path>[,<driver>[,permissive]]]] */ if (remmina_plugin_service->file_get_int(remminafile, "shareserial", FALSE)) { RDPDR_SERIAL* serial; - serial = (RDPDR_SERIAL*)malloc(sizeof(RDPDR_SERIAL)); - ZeroMemory(serial, sizeof(RDPDR_SERIAL)); + serial = (RDPDR_SERIAL*) calloc(1, sizeof(RDPDR_SERIAL)); serial->Type = RDPDR_DTYP_SERIAL; @@ -1359,8 +1354,7 @@ static gboolean remmina_rdp_main(RemminaProtocolWidget* gp) if (remmina_plugin_service->file_get_int(remminafile, "shareparallel", FALSE)) { RDPDR_PARALLEL* parallel; - parallel = (RDPDR_PARALLEL*)malloc(sizeof(RDPDR_PARALLEL)); - ZeroMemory(parallel, sizeof(RDPDR_PARALLEL)); + parallel = (RDPDR_PARALLEL*) calloc(1, sizeof(RDPDR_PARALLEL)); parallel->Type = RDPDR_DTYP_PARALLEL; |