Commit 5cee596c authored by Yong Cong Sin's avatar Yong Cong Sin Committed by Christopher Friedt
Browse files

subsys/mgmt/hawkbit: Cleanup connection if error after http_request



All errors that occured after http_request should clean up the
connection.

Signed-off-by: default avatarYong Cong Sin <yongcong.sin@gmail.com>
parent 22b5a033
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -718,7 +718,6 @@ static void response_cb(struct http_response *rsp,
					LOG_ERR("Failed to realloc memory");
					hb_context.code_status =
						HAWKBIT_METADATA_ERROR;
					cleanup_connection();
					break;
				}

@@ -793,7 +792,6 @@ static void response_cb(struct http_response *rsp,
					LOG_ERR("Failed to realloc memory");
					hb_context.code_status =
						HAWKBIT_METADATA_ERROR;
					cleanup_connection();
					break;
				}

@@ -1133,7 +1131,7 @@ enum hawkbit_response hawkbit_probe(void)
	}

	if (hb_context.code_status == HAWKBIT_METADATA_ERROR) {
		goto error;
		goto cleanup;
	}

	if (hawkbit_results.base.config.polling.sleep) {
@@ -1216,7 +1214,7 @@ enum hawkbit_response hawkbit_probe(void)
	}

	if (hb_context.code_status == HAWKBIT_METADATA_ERROR) {
		goto error;
		goto cleanup;
	}

	hawkbit_dump_deployment(&hawkbit_results.dep);