aboutsummaryrefslogtreecommitdiff
path: root/libqmenumodel
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2013-09-03 13:17:30 +0200
committerLars Uebernickel <lars.uebernickel@canonical.com>2013-09-03 13:17:30 +0200
commite01b6b5a513c57c7a52c1a14d4a44dcf6a42025d (patch)
tree5f28842dc67709fb0738c58df9136e31d73f31fa /libqmenumodel
parent936588550f0f91ee95386931a5297b46c3ba9c14 (diff)
downloadqmenumodel-e01b6b5a513c57c7a52c1a14d4a44dcf6a42025d.tar.gz
qmenumodel-e01b6b5a513c57c7a52c1a14d4a44dcf6a42025d.tar.bz2
qmenumodel-e01b6b5a513c57c7a52c1a14d4a44dcf6a42025d.zip
fullActioName: make sure 'name' is valid for the duration of the function
Diffstat (limited to 'libqmenumodel')
-rw-r--r--libqmenumodel/src/unitymenumodel.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/libqmenumodel/src/unitymenumodel.cpp b/libqmenumodel/src/unitymenumodel.cpp
index 2000d5b..a0ab4ff 100644
--- a/libqmenumodel/src/unitymenumodel.cpp
+++ b/libqmenumodel/src/unitymenumodel.cpp
@@ -785,10 +785,12 @@ void UnityMenuModel::unregisterAction(UnityMenuAction* action)
char * UnityMenuModelPrivate::fullActionName(UnityMenuAction *action)
{
GSequenceIter *iter;
+ QByteArray bytes;
const gchar *name;
gchar *full_name = NULL;
- name = action->name().toUtf8().constData();
+ bytes = action->name().toUtf8();
+ name = bytes.constData();
iter = g_sequence_get_iter_at_pos (this->items, action->index());
if (!g_sequence_iter_is_end (iter)) {