commit e744b035e05fc9e66dc659ddb3f52d3c7dcb0289
parent 07af9c8add3806f396b141d9f66b986e60af26f2
Author: Florian Dold <florian@dold.me>
Date: Mon, 17 Mar 2025 12:45:02 +0100
error handling
Diffstat:
2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/taler_wallet_core_lib.c b/taler_wallet_core_lib.c
@@ -350,6 +350,10 @@ TALER_pack_http_client_implementation(JSHttpReqCreateFn req_create,
{
// will (and should!) crash if this tiny malloc fails
struct JSHttpClientImplementation *impl = malloc(sizeof *impl);
+
+ if (!impl) {
+ return NULL;
+ }
impl->cls = handler_p;
impl->req_create = req_create;
impl->req_cancel = req_cancel;
diff --git a/taler_wallet_core_lib.h b/taler_wallet_core_lib.h
@@ -182,6 +182,7 @@ TALER_set_curl_http_client(struct TALER_WALLET_Instance *twi);
* @param req_create HTTP client implementation
* @param req_cancel HTTP client implementation
* @param handler_p Pointer to Handler's "this"
+ * or NULL if allocation failed
*/
struct JSHttpClientImplementation *
TALER_pack_http_client_implementation(JSHttpReqCreateFn req_create,