Skip to content

Commit

Permalink
Fix memory leak and add missing white spaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
jjnicola committed Oct 10, 2019
1 parent 25de575 commit a093336
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit a093336

Please sign in to comment.