>From f6aa5c1488cd55c7e88b91d7f9e0e89c37beaccb Mon Sep 17 00:00:00 2001
From: Christophe Dumez <christophe.dumez@intel.com>
Date: Mon, 16 May 2011 15:11:15 +0300
Subject: [PATCH 09/10] ContactEBook::getEContact() Fix unsafe QByteArray
 usage

Stop using the internal char array representation of a
temporary QByteArray object.
---
 engine/qcontactebook.cpp |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/engine/qcontactebook.cpp b/engine/qcontactebook.cpp
index 5ebadf8..618bf49 100644
--- a/engine/qcontactebook.cpp
+++ b/engine/qcontactebook.cpp
@@ -517,13 +517,14 @@ EContact* QContactEBook::getEContact(const QContactLocalId& contactId, QContactM
 {
   EContact* rtn = NULL;
 
-  const char* uid = QContactLocalId2UID(contactId).toUtf8().constData();
+  char* uid = strdup(QContactLocalId2UID(contactId).toUtf8().constData());
   GError *gError = NULL;
   if (e_book_get_contact(m_ebook, uid, &rtn, &gError)) {
     *error = QContactManager::NoError;
   } else {
     *error = getErrorFromError(gError);
   }
+  free(uid);
 
   return rtn;
 }
-- 
1.7.4.4

