ObexTransportAgent: Fix valgrind warnings (MB#10091)
Patrick found some valgrind warnings and put a prelimilary version of part of the fix. Finished the work in this patch. Added a libical timezone supression rule, with an additonal patch in libsynthesis and the updated supression rules, valgrind is happy.
This commit is contained in:
parent
96088dd114
commit
4704efac52
|
@ -57,9 +57,6 @@ ObexTransportAgent::ObexTransportAgent (OBEX_TRANS_TYPE type, GMainLoop *loop) :
|
|||
|
||||
ObexTransportAgent::~ObexTransportAgent()
|
||||
{
|
||||
if(m_buffer){
|
||||
free (m_buffer);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -176,6 +173,7 @@ void ObexTransportAgent::connectInit () {
|
|||
// blocking.
|
||||
sockaddr_rc any;
|
||||
bdaddr_t anyaddr ={{0,0,0,0,0,0}};
|
||||
memset(&any, 0, sizeof(any));
|
||||
any.rc_family = AF_BLUETOOTH;
|
||||
bacpy (&any.rc_bdaddr, &anyaddr);
|
||||
any.rc_channel = 0;
|
||||
|
@ -195,6 +193,7 @@ void ObexTransportAgent::connectInit () {
|
|||
cxxptr<ObexEvent> obexEvent (new ObexEvent (obexEventSource));
|
||||
//connect to remote device
|
||||
sockaddr_rc peer;
|
||||
memset(&peer, 0, sizeof(peer));
|
||||
peer.rc_family = AF_BLUETOOTH;
|
||||
bacpy (&peer.rc_bdaddr , &bdaddr);
|
||||
peer.rc_channel = m_port;
|
||||
|
@ -703,7 +702,8 @@ void ObexTransportAgent::obex_callback (obex_object_t *object, int mode, int eve
|
|||
m_connectId = header.bq4;
|
||||
} else if (headertype == OBEX_HDR_WHO) {
|
||||
SE_LOG_DEV (NULL, NULL,
|
||||
"OBEX Transport: get header who from connect response with value %s", header.bs);
|
||||
"OBEX Transport: get header who from connect response with value %.*s",
|
||||
len, header.bs);
|
||||
} else {
|
||||
SE_LOG_WARNING (NULL, NULL,
|
||||
"OBEX Transport: Unknow header from connect response");
|
||||
|
@ -747,19 +747,9 @@ void ObexTransportAgent::obex_callback (obex_object_t *object, int mode, int eve
|
|||
SE_LOG_ERROR (NULL, NULL,
|
||||
"ObexTransport: Get zero sized response body for Get");
|
||||
}
|
||||
if(!m_buffer) {
|
||||
free (m_buffer);
|
||||
m_buffer = NULL;
|
||||
}
|
||||
m_buffer = new char[length];
|
||||
m_buffer.set(new char[length], "buffer");
|
||||
m_bufferSize = length;
|
||||
if(m_buffer) {
|
||||
memcpy (m_buffer, header.bs, length);
|
||||
} else {
|
||||
m_status = FAILED;
|
||||
SE_LOG_ERROR (NULL, NULL, "Allocating buffer failed");
|
||||
return;
|
||||
}
|
||||
memcpy (m_buffer, header.bs, length);
|
||||
} else {
|
||||
SE_LOG_WARNING (NULL, NULL, "Unknow header received for Get cmd");
|
||||
}
|
||||
|
|
|
@ -169,7 +169,7 @@ class ObexTransportAgent : public TransportAgent
|
|||
cxxptr<Channel> m_channel;
|
||||
|
||||
std::string m_contentType;
|
||||
char *m_buffer;
|
||||
arrayptr<char> m_buffer;
|
||||
int m_bufferSize;
|
||||
|
||||
sdp_session_t *m_sdp;
|
||||
|
|
|
@ -2858,10 +2858,10 @@ bool SyncContext::sendSAN(uint16_t version)
|
|||
// Time out after the complete retry duration. This is the
|
||||
// initial message of a sync, so we don't resend it (just as
|
||||
// in a HTTP SyncML client trying to contact server).
|
||||
if (m_retryDuration) {
|
||||
setTransportCallback(m_retryDuration);
|
||||
int retryDuration = getRetryDuration();
|
||||
if (retryDuration) {
|
||||
setTransportCallback(retryDuration);
|
||||
}
|
||||
|
||||
SE_LOG_INFO (NULL, NULL, "Server sending SAN");
|
||||
m_agent->setContentType(!legacy ?
|
||||
TransportAgent::m_contentTypeServerAlertedNotificationDS
|
||||
|
|
|
@ -74,3 +74,20 @@
|
|||
fun:__pthread_initialize_manager
|
||||
fun:pthread_create@@GLIBC_2.1
|
||||
}
|
||||
|
||||
{
|
||||
libical tzutil invalid access
|
||||
Memcheck:Addr4
|
||||
fun:icaltzutil_fetch_timezone
|
||||
obj:/usr/lib/libical.so.0.43.0
|
||||
fun:icaltimezone_get_component
|
||||
fun:_ZN6sysync25loadSystemZoneDefinitionsEPNS_6GZonesE
|
||||
fun:_ZN6sysync6GZones10initializeEv
|
||||
fun:_ZN6sysync12TSyncAppBaseC2Ev
|
||||
fun:_ZN6sysync22TEngineSessionDispatchC2Ev
|
||||
fun:_ZN6sysync23TCustomServerEngineBaseC1Ev
|
||||
fun:_ZN6sysync28TCustomServerEngineInterface14newSyncAppBaseEv
|
||||
fun:_ZN6sysync16TEngineInterface4InitEv
|
||||
fun:_ZN6sysync17TEngineModuleBase7ConnectESsmt
|
||||
fun:_ZN6sysyncL22internal_ConnectEngineEbPPNS_17SDK_InterfaceTypeEtPmmt
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue