From 2da98808e7484e69f14b19a1039ded34a954f64e Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 26 Aug 2009 14:20:09 +0200 Subject: eliminate AddOpenGPGPublicKey() and AddBlackListedPackage() stubs Signed-off-by: Denys Vlasenko --- src/Daemon/CrashWatcher.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'src/Daemon/CrashWatcher.cpp') diff --git a/src/Daemon/CrashWatcher.cpp b/src/Daemon/CrashWatcher.cpp index 26e906fa..01629f0b 100644 --- a/src/Daemon/CrashWatcher.cpp +++ b/src/Daemon/CrashWatcher.cpp @@ -175,19 +175,16 @@ static void *create_report(void *arg) uint64_t CCrashWatcher::CreateReport_t(const std::string &pUUID,const std::string &pUID, const std::string &pSender) { thread_data_t *thread_data = (thread_data_t *)xzalloc(sizeof(thread_data_t)); - if (thread_data != NULL) + thread_data->UUID = xstrdup(pUUID.c_str()); + thread_data->UID = xstrdup(pUID.c_str()); + thread_data->dest = xstrdup(pSender.c_str()); + if (pthread_create(&(thread_data->thread_id), NULL, create_report, (void *)thread_data) != 0) { - thread_data->UUID = xstrdup(pUUID.c_str()); - thread_data->UID = xstrdup(pUID.c_str()); - thread_data->dest = xstrdup(pSender.c_str()); - if (pthread_create(&(thread_data->thread_id), NULL, create_report, (void *)thread_data) != 0) - { - throw CABRTException(EXCEP_FATAL, "CCrashWatcher::CreateReport_t(): Cannot create thread!"); - } - } - else - { - throw CABRTException(EXCEP_FATAL, "CCrashWatcher::CreateReport_t(): Cannot allocate memory!"); + free(thread_data->UUID); + free(thread_data->UID); + free(thread_data->dest); + free(thread_data); + throw CABRTException(EXCEP_FATAL, "CCrashWatcher::CreateReport_t(): Cannot create thread!"); } //FIXME: we don't use this value anymore, so fix the API return 0; -- cgit