Skip to content

Commit b51923b

Browse files
committed
Move openvasd_start_scan warning up in case the cJSON err is empty
1 parent 5c33575 commit b51923b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

openvasd/openvasd.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,7 @@ openvasd_start_scan (openvasd_connector_t conn, gchar *data)
810810
if (!parser)
811811
{
812812
const gchar *error_ptr = cJSON_GetErrorPtr ();
813+
g_warning ("%s: Error parsing json string to get the scan ID", __func__);
813814
if (error_ptr != NULL)
814815
{
815816
response->body = g_strdup_printf ("{\"error\": \"%s\"}", error_ptr);
@@ -819,7 +820,6 @@ openvasd_start_scan (openvasd_connector_t conn, gchar *data)
819820
{
820821
response->body = g_strdup (
821822
"{\"error\": \"Parsing json string to get the scan ID\"}");
822-
g_warning ("%s: Parsing json string to get the scan ID", __func__);
823823
}
824824
response->code = RESP_CODE_ERR;
825825
cJSON_Delete (parser);

0 commit comments

Comments
 (0)