# HG changeset patch # User Matti Hamalainen # Date 1583851915 -7200 # Node ID 3707a823aa02517af2e2d3388e979182d7ebb656 # Parent 29d9083dff1c8158664e9ec3ed96bd579aa412d8 Fix to the previous commit. strdup the mode string since the argument is const. diff -r 29d9083dff1c -r 3707a823aa02 th_ioctx.c --- 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));