Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

Prevent containerH being used after it was freed

Michał Janiszewski1d0596c8d804
diff --git a/toonz/sources/common/twain/ttwain_capability.c b/toonz/sources/common/twain/ttwain_capability.c
index 7fa9d5cfb..2ae88ad12 100644
--- a/toonz/sources/common/twain/ttwain_capability.c
+++ b/toonz/sources/common/twain/ttwain_capability.c
@@ -273,6 +273,7 @@ int TTWAIN_SetCap(TW_UINT16 cap_id, TW_UINT16 conType, TW_UINT16 itemType,
if (!capabilityH) {
GLOBAL_UNLOCK(containerH);
GLOBAL_FREE(containerH);
+ containerH = NULL;
goto done;
}