From 36b475a04fa89361421c5932c8a9fb4186069699 Mon Sep 17 00:00:00 2001 From: Frederic Suter Date: Tue, 18 Jul 2017 09:21:11 +0200 Subject: [PATCH] plug two more leaks --- include/simgrid/s4u/Storage.hpp | 2 +- src/s4u/s4u_storage.cpp | 2 +- teshsuite/s4u/storage_client_server/storage_client_server.cpp | 2 +- teshsuite/xbt/parallel_log_crashtest/parallel_log_crashtest.c | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/simgrid/s4u/Storage.hpp b/include/simgrid/s4u/Storage.hpp index 854e0f9ab9..2ece591608 100644 --- a/include/simgrid/s4u/Storage.hpp +++ b/include/simgrid/s4u/Storage.hpp @@ -38,7 +38,7 @@ public: xbt_dict_t getProperties(); const char* getProperty(const char* key); - void setProperty(const char* key, char* value); + void setProperty(const char* key, const char* value); std::map* getContent(); void setUserdata(void* data) { userdata_ = data; } diff --git a/src/s4u/s4u_storage.cpp b/src/s4u/s4u_storage.cpp index f746562730..74770d9ea6 100644 --- a/src/s4u/s4u_storage.cpp +++ b/src/s4u/s4u_storage.cpp @@ -70,7 +70,7 @@ const char* Storage::getProperty(const char* key) return this->pimpl_->getProperty(key); } -void Storage::setProperty(const char* key, char* value) +void Storage::setProperty(const char* key, const char* value) { simgrid::simix::kernelImmediate([this, key, value] { this->pimpl_->setProperty(key, value); }); } diff --git a/teshsuite/s4u/storage_client_server/storage_client_server.cpp b/teshsuite/s4u/storage_client_server/storage_client_server.cpp index 10ea0648e2..db4614c31e 100644 --- a/teshsuite/s4u/storage_client_server/storage_client_server.cpp +++ b/teshsuite/s4u/storage_client_server/storage_client_server.cpp @@ -98,7 +98,7 @@ static void dump_platform_storages() for (auto storage : *storages) { XBT_INFO("Storage %s is attached to %s", storage.first.c_str(), storage.second->getHost()->getCname()); - storage.second->setProperty("other usage", xbt_strdup("gpfs")); + storage.second->setProperty("other usage", "gpfs"); } delete storages; } diff --git a/teshsuite/xbt/parallel_log_crashtest/parallel_log_crashtest.c b/teshsuite/xbt/parallel_log_crashtest/parallel_log_crashtest.c index 76cce8ddd4..ab85f5dac6 100644 --- a/teshsuite/xbt/parallel_log_crashtest/parallel_log_crashtest.c +++ b/teshsuite/xbt/parallel_log_crashtest/parallel_log_crashtest.c @@ -6,6 +6,7 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ +#include "simgrid/msg.h" #include "xbt.h" XBT_LOG_NEW_DEFAULT_CATEGORY(synchro_crashtest, "Logs of this example"); @@ -36,8 +37,6 @@ static int crasher(int argc, char *argv[]) int i; xbt_os_thread_t *crashers; - xbt_init(&argc, argv); - /* initializations of the philosopher mechanisms */ id = xbt_new0(int, crasher_amount); crashers = xbt_new(xbt_os_thread_t, crasher_amount); @@ -64,5 +63,6 @@ static int crasher(int argc, char *argv[]) int main(int argc, char *argv[]) { + MSG_init(&argc, argv); return crasher(argc, argv); } -- 2.20.1