From a093336b93fd457d639189fb00b1660b7f1be98b Mon Sep 17 00:00:00 2001 From: Juan Jose Nicola Date: Thu, 10 Oct 2019 12:39:53 +0200 Subject: [PATCH] Fix memory leak and add missing white spaces. --- src/manage.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/manage.c b/src/manage.c index 82e4a0711..a98a0c15d 100644 --- a/src/manage.c +++ b/src/manage.c @@ -3785,10 +3785,12 @@ target_osp_ssh_credential (target_t target) if (strcmp (type, "usk") == 0) { const char *private_key = credential_iterator_private_key (&iter); + gchar *base64 = g_base64_encode ((guchar *) private_key, + strlen (private_key)); osp_credential_set_auth_data (osp_credential, - "private", - g_base64_encode ((guchar *) private_key, - strlen(private_key))); + "private", base64); + g_free (base64); + } cleanup_iterator (&iter); return osp_credential; @@ -4093,7 +4095,7 @@ launch_osp_openvas_task (task_t task, target_t target, const char *scan_id, g_strfreev (split_value); } else if (strcmp (type, "file") == 0) - osp_value = g_base64_encode ((guchar*) value, strlen(value)); + osp_value = g_base64_encode ((guchar*) value, strlen (value)); osp_vt = g_hash_table_lookup (vts_hash_table, oid); if (osp_vt)