X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Factions%2Fexecute.c;h=fdce77b7c1c3cbbd647e36f49ce2a7ee21264b7f;hb=b7ddaa5728b5449449e3ea14cf84252285bbc794;hp=ed205364bac4b192f8aacf70fc3e93c98908c75b;hpb=580e2167f86c821d34bbe7e2c3011e68df3f151e;p=chaz%2Fopenbox diff --git a/openbox/actions/execute.c b/openbox/actions/execute.c index ed205364..fdce77b7 100644 --- a/openbox/actions/execute.c +++ b/openbox/actions/execute.c @@ -53,7 +53,7 @@ static gpointer setup_func(xmlNodePtr node) xmlNodePtr n; Options *o; - o = g_new0(Options, 1); + o = g_slice_new0(Options); if ((n = obt_xml_find_node(node, "command")) || (n = obt_xml_find_node(node, "execute"))) @@ -97,21 +97,22 @@ static void free_func(gpointer options) g_free(o->sn_icon); g_free(o->sn_wmclass); g_free(o->prompt); - if (o->data) g_free(o->data); - g_free(o); + if (o->data) g_slice_free(ObActionsData, o->data); + g_slice_free(Options, o); } } static Options* dup_options(Options *in, ObActionsData *data) { - Options *o = g_new(Options, 1); + Options *o = g_slice_new(Options); o->cmd = g_strdup(in->cmd); o->sn = in->sn; o->sn_name = g_strdup(in->sn_name); o->sn_icon = g_strdup(in->sn_icon); o->sn_wmclass = g_strdup(in->sn_wmclass); o->prompt = NULL; - o->data = g_memdup(data, sizeof(ObActionsData)); + o->data = g_slice_new(ObActionsData); + memcpy(o->data, data, sizeof(ObActionsData)); return o; } @@ -231,7 +232,7 @@ static gboolean run_func(ObActionsData *data, gpointer options) e = NULL; if (!g_shell_parse_argv(cmd, NULL, &argv, &e)) { - g_message(e->message, o->cmd); + g_message("%s", e->message); g_error_free(e); } else { @@ -253,7 +254,7 @@ static gboolean run_func(ObActionsData *data, gpointer options) G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL, NULL, &e); if (!ok) { - g_message(e->message, o->cmd); + g_message("%s", e->message); g_error_free(e); }