summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJackLivio <jack@livio.io>2017-10-03 17:08:12 -0400
committerGitHub <noreply@github.com>2017-10-03 17:08:12 -0400
commit3eb15fc00df9e548bb272f7dc8e70c4ac9c15f02 (patch)
tree75b60b9c2b33de479d066cf7d27962a294c677a9
parentda4b5766ca3f1fca4caa4b4815073f72dfe37182 (diff)
parent1b7b9eef9897c3126b94163fd820ad691cb59825 (diff)
downloadsdl_core-3eb15fc00df9e548bb272f7dc8e70c4ac9c15f02.tar.gz
Merge pull request #1691 from shoamano83/fix/memory_issue_in_from_mic_to_file_recorder
fix: memory issue in FromMicToFileRecorderThread
-rw-r--r--src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc b/src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc
index 0239795d75..a514959701 100644
--- a/src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc
+++ b/src/components/media_manager/src/audio/from_mic_to_file_recorder_thread.cc
@@ -32,6 +32,7 @@
#include "media_manager/audio/from_mic_to_file_recorder_thread.h"
#include <unistd.h>
+#include <cstring>
#include <sstream>
#include "utils/logger.h"
@@ -88,11 +89,11 @@ void FromMicToFileRecorderThread::initArgs() {
argv_[3] = new gchar[3];
argv_[4] = new gchar[durationString_.length() + 1];
- argv_[0] = const_cast<gchar*>(std::string("AudioManager").c_str());
- argv_[1] = const_cast<gchar*>(oKey_.c_str());
- argv_[2] = const_cast<gchar*>(outputFileName_.c_str());
- argv_[3] = const_cast<gchar*>(tKey_.c_str());
- argv_[4] = const_cast<gchar*>(durationString_.c_str());
+ std::strcpy(argv_[0], "AudioManager");
+ std::strcpy(argv_[1], oKey_.c_str());
+ std::strcpy(argv_[2], outputFileName_.c_str());
+ std::strcpy(argv_[3], tKey_.c_str());
+ std::strcpy(argv_[4], durationString_.c_str());
}
void FromMicToFileRecorderThread::threadMain() {