summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2014-01-08 05:07:28 -0800
committerPatrick Ohly <patrick.ohly@intel.com>2014-01-08 05:07:28 -0800
commit4265685eb93d28bcb6e21853131b51a89291bd5b (patch)
treef7af097921667691b46a448bba1e40e86918ee41
parent38970617f539e6b08be4b2c81a211952aa52ced9 (diff)
SyncML TK: fix invalid memory allocation
Some unused code allocated memory sufficient for only for a *pointer* instead a *structure* as it should have done. Found by clang's scan-build, for example: Result of 'malloc' is converted to a pointer of type 'struct sml_filter_s', which is incompatible with sizeof operand type 'SmlFilterPtr_t'
-rwxr-xr-xsrc/syncml_tk/src/sml/mgr/all/mgrutil.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/syncml_tk/src/sml/mgr/all/mgrutil.c b/src/syncml_tk/src/sml/mgr/all/mgrutil.c
index 93633b0..ee793b9 100755
--- a/src/syncml_tk/src/sml/mgr/all/mgrutil.c
+++ b/src/syncml_tk/src/sml/mgr/all/mgrutil.c
@@ -912,7 +912,7 @@ SML_API SmlCredPtr_t smlAllocCred() {
SML_API SmlRecordOrFieldFilterPtr_t smlAllocRecordFieldFilter()
{
- SmlRecordOrFieldFilterPtr_t p = (SmlRecordOrFieldFilterPtr_t)smlLibMalloc(sizeof(SmlRecordOrFieldFilterPtr_t));
+ SmlRecordOrFieldFilterPtr_t p = (SmlRecordOrFieldFilterPtr_t)smlLibMalloc(sizeof(SmlRecordOrFieldFilter_t));
if (p == NULL) return NULL;
smlLibMemset(p, 0, sizeof(SmlRecordOrFieldFilterPtr_t));
p->item = smlAllocItem();
@@ -925,7 +925,7 @@ SML_API SmlRecordOrFieldFilterPtr_t smlAllocRecordFieldFilter()
SML_API SmlFilterPtr_t smlAllocFilter()
{
- SmlFilterPtr_t p = (SmlFilterPtr_t)smlLibMalloc(sizeof(SmlFilterPtr_t));
+ SmlFilterPtr_t p = (SmlFilterPtr_t)smlLibMalloc(sizeof(SmlFilter_t));
if (p == NULL) return NULL;
smlLibMemset(p, 0, sizeof(SmlFilterPtr_t));
p->meta = smlAllocPcdata();
@@ -939,7 +939,7 @@ SML_API SmlFilterPtr_t smlAllocFilter()
SML_API SmlSourceParentPtr_t smlAllocSourceParent()
{
- SmlSourceParentPtr_t p = (SmlSourceParentPtr_t)smlLibMalloc(sizeof(SmlSourceParentPtr_t));
+ SmlSourceParentPtr_t p = (SmlSourceParentPtr_t)smlLibMalloc(sizeof(SmlSourceParent_t));
if (p == NULL) return NULL;
smlLibMemset(p, 0, sizeof(SmlSourceParentPtr_t));
p->locURI = smlAllocPcdata();