summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/cc4group.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/cc4group.c b/src/cc4group.c
index 48fa931..f980183 100644
--- a/src/cc4group.c
+++ b/src/cc4group.c
@@ -1890,6 +1890,10 @@ static bool cc4group_setEntryData(CC4Group* const this, const char* const entryP
if(entry->data != NULL)
{
cc4group_applyMemoryManagementEnd(entry->memoryManagement, entry->data);
+
+ entry->data = NULL;
+ entry->core.Size = 0;
+ entry->memoryManagement = Reference;
}
if(data != NULL && size != 0)
@@ -1902,17 +1906,11 @@ static bool cc4group_setEntryData(CC4Group* const this, const char* const entryP
}
else
{
- entry->data = (void*)data;
+ entry->data = (uint8_t*)ownData;
}
entry->core.Size = size;
entry->memoryManagement = memoryManagement;
}
- else
- {
- entry->data = NULL;
- entry->core.Size = 0;
- entry->memoryManagement = Reference;
- }
entry->core.HasCRC = C4GroupEntryCore_NoCRC;