From f4ca3139aa5b0e98f390a500fae17c156528ef85 Mon Sep 17 00:00:00 2001 From: Kyeonghun Lee Date: Thu, 11 Feb 2016 15:55:27 +0900 Subject: [PATCH] alloc-dealloc mismatch bug fixed Change-Id: Ie1ff7f77182d235705672a64e01ff5a763945e6e Signed-off-by: Kyeonghun Lee --- plugin/sms_plugin/SmsPluginParamCodec.cpp | 4 ++-- plugin/sms_plugin/include/SmsPluginTypes.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/plugin/sms_plugin/SmsPluginParamCodec.cpp b/plugin/sms_plugin/SmsPluginParamCodec.cpp index bb40be6..a3d7709 100755 --- a/plugin/sms_plugin/SmsPluginParamCodec.cpp +++ b/plugin/sms_plugin/SmsPluginParamCodec.cpp @@ -112,7 +112,7 @@ int SmsPluginParamCodec::encodeTime(const SMS_TIMESTAMP_S *pTimeStamp, char **pp int SmsPluginParamCodec::encodeDCS(const SMS_DCS_S *pDCS, char **ppParam) { - *ppParam = new char; + *ppParam = new char[MAX_DCS_PARAM_LEN]; **ppParam = 0x00; @@ -164,7 +164,7 @@ int SmsPluginParamCodec::encodeDCS(const SMS_DCS_S *pDCS, char **ppParam) return 0; } - return 1; + return MAX_DCS_PARAM_LEN; } diff --git a/plugin/sms_plugin/include/SmsPluginTypes.h b/plugin/sms_plugin/include/SmsPluginTypes.h index 3d74b7e..646947f 100755 --- a/plugin/sms_plugin/include/SmsPluginTypes.h +++ b/plugin/sms_plugin/include/SmsPluginTypes.h @@ -43,6 +43,7 @@ extern "C" #define MAX_SMS_SEND_RETRY 4 #define MAX_SMSC_LEN 20 #define MAX_ADD_PARAM_LEN 12 +#define MAX_DCS_PARAM_LEN 1 #define MAX_ABS_TIME_PARAM_LEN 7 #define MAX_REL_TIME_PARAM_LEN 1 #define MAX_UD_HEADER_NUM 7 -- 2.7.4