diff --git a/src/e_mod_popup.c b/src/e_mod_popup.c index 54f40ae..c8ef68a 100644 --- a/src/e_mod_popup.c +++ b/src/e_mod_popup.c @@ -523,6 +523,7 @@ e_iwd_popup_toggle(E_Gadcon_Client *gcc) if (!gcc || !e_iwd) return; Popup *p = calloc(1, sizeof(*p)); + if (!p) return; _popup = p; p->gp = e_gadcon_popup_new(gcc, EINA_FALSE); diff --git a/src/iwd/iwd_agent.c b/src/iwd/iwd_agent.c index df8a5b4..e378039 100644 --- a/src/iwd/iwd_agent.c +++ b/src/iwd/iwd_agent.c @@ -73,6 +73,9 @@ _request_passphrase_cb(const Eldbus_Service_Interface *iface EINA_UNUSED, "No UI handler"); Iwd_Agent_Request *req = calloc(1, sizeof(*req)); + if (!req) + return eldbus_message_error_new(msg, "net.connman.iwd.Agent.Error.Canceled", + "Out of memory"); req->agent = _self; req->msg = eldbus_message_ref((Eldbus_Message *)msg); _self->cb(_self->data, req, path); diff --git a/src/iwd/iwd_manager.c b/src/iwd/iwd_manager.c index 941e907..ec4648e 100644 --- a/src/iwd/iwd_manager.c +++ b/src/iwd/iwd_manager.c @@ -63,6 +63,7 @@ iwd_manager_listener_add(Iwd_Manager *m, Iwd_Manager_Cb cb, void *data) { if (!m || !cb) return; Listener *l = calloc(1, sizeof(*l)); + if (!l) return; l->cb = cb; l->data = data; m->listeners = eina_list_append(m->listeners, l); } diff --git a/src/ui/wifi_auth.c b/src/ui/wifi_auth.c index 24d21d3..81bcfce 100644 --- a/src/ui/wifi_auth.c +++ b/src/ui/wifi_auth.c @@ -68,6 +68,7 @@ wifi_auth_prompt(Evas_Object *parent EINA_UNUSED, const char *ssid, Wifi_Auth_Cb cb, void *data) { Auth_Ctx *c = calloc(1, sizeof(*c)); + if (!c) return NULL; c->cb = cb; c->data = data; /* A floating top-level window so the popup is actually visible — diff --git a/src/ui/wifi_hidden.c b/src/ui/wifi_hidden.c index e6b9252..2f93215 100644 --- a/src/ui/wifi_hidden.c +++ b/src/ui/wifi_hidden.c @@ -104,6 +104,7 @@ void wifi_hidden_prompt(Evas_Object *parent EINA_UNUSED, Wifi_Hidden_Cb cb, void *data) { Hidden_Ctx *c = calloc(1, sizeof(*c)); + if (!c) { if (cb) cb(data, NULL, NULL, EINA_FALSE); return; } c->cb = cb; c->data = data; /* Floating top-level so the popup actually shows. */