changeset 699:3707a823aa02

Fix to the previous commit. strdup the mode string since the argument is const.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 10 Mar 2020 16:51:55 +0200
parents 29d9083dff1c
children ec8fe89576ff
files th_ioctx.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/th_ioctx.c	Tue Mar 10 16:47:57 2020 +0200
+++ b/th_ioctx.c	Tue Mar 10 16:51:55 2020 +0200
@@ -106,7 +106,9 @@
     }
     else
     {
-        ctx->mode = mode;
+        ctx->mallocated = TRUE;
+        if ((ctx->mode = th_strdup(mode)) == NULL)
+            return THERR_MALLOC;
     }
 
     return (ctx->status = thfopen(ctx));