From 7a404e7fbca7894cdda76f7b0ddfed855a732424 Mon Sep 17 00:00:00 2001 From: "Vladimir A. Pavlov" Date: Mon, 22 Oct 2012 19:28:35 +0400 Subject: Store XClassHint on stack, not in dynamic memory --- util/fbrun/FbRun.cc | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/util/fbrun/FbRun.cc b/util/fbrun/FbRun.cc index 9ed3186..fac09b9 100644 --- a/util/fbrun/FbRun.cc +++ b/util/fbrun/FbRun.cc @@ -79,14 +79,11 @@ FbRun::FbRun(int x, int y, size_t width): resize(width, font().height() + m_bevel); // setup class name - XClassHint *class_hint = XAllocClassHint(); - if (class_hint == 0) - throw string("Out of memory"); - class_hint->res_name = const_cast("fbrun"); - class_hint->res_class = const_cast("FbRun"); - XSetClassHint(m_display, window(), class_hint); - - XFree(class_hint); + XClassHint ch; + ch.res_name = const_cast("fbrun"); + ch.res_class = const_cast("FbRun"); + XSetClassHint(m_display, window(), &ch); + #ifdef HAVE_XPM Pixmap mask = 0; Pixmap pm; -- cgit v0.11.2