dwlb

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 8f0823f5513a7c0cf3948d8e14daa35714edf63f
parent bb2184df4aaed65f86bceac3b9054db434b56d67
Author: Janne Veteläinen <janne.vetelainen@elisanet.fi>
Date:   Sat, 13 Apr 2024 05:23:59 +0300

Calloc instead of malloc

Diffstat:
Mstatusnotifierhost.c | 26++++++--------------------
1 file changed, 6 insertions(+), 20 deletions(-)

diff --git a/statusnotifierhost.c b/statusnotifierhost.c @@ -99,36 +99,22 @@ register_statusnotifieritem(const char *busname, const char *busobj, StatusNotifierHost *snhost) { + char *xml_path = g_strdup_printf("%s%s", RESOURCE_PATH, "/StatusNotifierItem.xml"); + StatusNotifierItem *snitem; - snitem = g_malloc(sizeof(StatusNotifierItem)); + snitem = g_malloc0(sizeof(StatusNotifierItem)); + snitem->host = snhost; snitem->busname = g_strdup(busname); snitem->busobj = g_strdup(busobj); - - snitem->host = snhost; - - char *xml_path = g_strdup_printf("%s%s", RESOURCE_PATH, "/StatusNotifierItem.xml"); snitem->nodeinfo = get_interface_info(xml_path); - g_free(xml_path); - - snitem->action_cb_data_slist = NULL; - snitem->actiongroup = NULL; - snitem->icon = NULL; - snitem->iconname = NULL; - snitem->iconpixmap_v = NULL; - snitem->menu = NULL; - snitem->menunodeinfo = NULL; - snitem->menuobj = NULL; - snitem->menuproxy = NULL; - snitem->paintable = NULL; - snitem->popovermenu = NULL; snhost->noitems = snhost->noitems + 1; + snhost->trayitems = g_slist_prepend(snhost->trayitems, snitem); + g_free(xml_path); dwlb_request_resize(snhost); - snhost->trayitems = g_slist_prepend(snhost->trayitems, snitem); - g_dbus_proxy_new(snhost->conn, G_DBUS_PROXY_FLAGS_NONE, snitem->nodeinfo->interfaces[0],