Fix issue #382
authorJulien Kerihuel <j.kerihuel@openchange.org>
Mon, 27 Feb 2012 13:43:33 +0000 (13:43 +0000)
committerJulien Kerihuel <j.kerihuel@openchange.org>
Mon, 27 Feb 2012 13:43:33 +0000 (13:43 +0000)
Patch from Olly Betts:

Avoid needlessly lpProps allocation before calling GetProps

libexchange2ical/exchange2ical.c
libexchange2ical/exchange2ical_property.c
utils/exchange2mbox.c
utils/openchange-tools.c
utils/openchangeclient.c

index 36b452c164928c335c0256b9ee282d0a08d1a096..2aa417d86a0887fbddf48e6198219747517d0a26 100644 (file)
@@ -425,7 +425,7 @@ static uint8_t exchange2ical_exception_from_EmbeddedObj(struct exchange2ical *ex
                                                                          PR_ATTACHMENT_HIDDEN
                                                                          );
                                                                          
-                               lpProps = talloc_zero(exchange2ical->mem_ctx, struct SPropValue);
+                               lpProps = NULL;
                                retval = GetProps(&obj_attach, 0, SPropTagArray, &lpProps, &count);
                                MAPIFreeBuffer(SPropTagArray);
                                if (retval != MAPI_E_SUCCESS) {
index bcb3cdb48e0783f0b2d9b0ab5e7dbf051b4da868..c68313d6a877a356e659c38d64f9de37e2e14005 100644 (file)
@@ -90,7 +90,7 @@ void ical_property_ATTACH(struct exchange2ical *exchange2ical)
                                                                          PR_ATTACH_DATA_BIN
                                                                          );
                                                                          
-                               lpProps = talloc_zero(exchange2ical->mem_ctx, struct SPropValue);
+                               lpProps = NULL;
                                retval = GetProps(&obj_attach, MAPI_UNICODE, SPropTagArray, &lpProps, &count);
                                MAPIFreeBuffer(SPropTagArray);
                                if (retval == MAPI_E_SUCCESS) {
index 04b23443bfa15a9edd8c41dd2bb268fe8cc960a8..b3c9b00fa9b652083e5e5c9cf83fe88067c55800 100644 (file)
@@ -830,7 +830,7 @@ old_code:
                                                                          PR_ATTACH_SIZE,
                                                                          PR_ATTACH_MIME_TAG,
                                                                          PR_ATTACH_METHOD);
-                                       lpProps = talloc_zero(mem_ctx, struct SPropValue);
+                                       lpProps = NULL;
                                        retval = GetProps(&obj_attach, MAPI_UNICODE, SPropTagArray, &lpProps, &count);
                                        MAPIFreeBuffer(SPropTagArray);
                                        if (retval == MAPI_E_SUCCESS) {
index c2f1d79bfb6c4608b380250856508a98d24dcfde..307487807b772556eb2ff980b400a548a0d28bdb 100644 (file)
@@ -217,7 +217,7 @@ _PUBLIC_ enum MAPISTATUS octool_message(TALLOC_CTX *mem_ctx,
                                          PR_DISPLAY_BCC_UNICODE,
                                          PR_HASATTACH,
                                          PR_MESSAGE_CODEPAGE);
-       lpProps = talloc_zero(mem_ctx, struct SPropValue);
+       lpProps = NULL;
        retval = GetProps(obj_message, MAPI_UNICODE, SPropTagArray, &lpProps, &count);
        MAPIFreeBuffer(SPropTagArray);
        MAPI_RETVAL_IF(retval, retval, NULL);
index dd0004f7a2215b96233311a7666752bd72b99b44..991b18871950d4923f4c056aeebcfe1ec96d3503 100644 (file)
@@ -450,7 +450,7 @@ static enum MAPISTATUS openchangeclient_fetchmail(mapi_object_t *obj_store,
                                        struct SRow             aRow;
                                        
                                        SPropTagArray = set_SPropTagArray(mem_ctx, 0x1, PR_HASATTACH);
-                                       lpProps = talloc_zero(mem_ctx, struct SPropValue);
+                                       lpProps = NULL;
                                        retval = GetProps(&obj_message, 0, SPropTagArray, &lpProps, &count);
                                        MAPIFreeBuffer(SPropTagArray);
                                        if (retval != MAPI_E_SUCCESS) return retval;
@@ -488,7 +488,7 @@ static enum MAPISTATUS openchangeclient_fetchmail(mapi_object_t *obj_store,
                                                                                                          PR_ATTACH_LONG_FILENAME,
                                                                                                          PR_ATTACH_SIZE,
                                                                                                          PR_ATTACH_CONTENT_ID);
-                                                                       lpProps2 = talloc_zero(mem_ctx, struct SPropValue);
+                                                                       lpProps2 = NULL;
                                                                        retval = GetProps(&obj_attach, MAPI_UNICODE, SPropTagArray, &lpProps2, &count2);
                                                                        MAPIFreeBuffer(SPropTagArray);
                                                                        if (retval != MAPI_E_SUCCESS) return retval;