diff --git a/OpenChange/MAPIStoreMessage.m b/OpenChange/MAPIStoreMessage.m index 444ecd0fb..fc20dd0d0 100644 --- a/OpenChange/MAPIStoreMessage.m +++ b/OpenChange/MAPIStoreMessage.m @@ -795,7 +795,7 @@ rtf2html (NSData *compressedRTF) TALLOC_CTX *localMemCtx; char *prefix, *normalizedSubject; - localMemCtx = talloc_zero (NULL, TALLOC_CTX); + localMemCtx = talloc_zero (memCtx, TALLOC_CTX); if ([self getProperty: (void **) &prefix withTag: PidTagSubjectPrefix inMemCtx: localMemCtx] @@ -807,6 +807,8 @@ rtf2html (NSData *compressedRTF) if (rc == MAPISTORE_SUCCESS) *data = talloc_asprintf (memCtx, "%s%s", prefix, normalizedSubject); + talloc_free(localMemCtx); + return rc; }