From: Christian Göttsche <cgzones@xxxxxxxxxxxxxx> Avoid unnecessary allocations. Signed-off-by: Christian Göttsche <cgzones@xxxxxxxxxxxxxx> --- mcstrans/src/mcscolor.c | 2 +- mcstrans/src/mcstrans.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mcstrans/src/mcscolor.c b/mcstrans/src/mcscolor.c index 9ff0ce2f..ef3752a0 100644 --- a/mcstrans/src/mcscolor.c +++ b/mcstrans/src/mcscolor.c @@ -101,7 +101,7 @@ static int check_dominance(const char *pattern, const char *raw) { ctx = NULL; if (context_range_set(my_tmp, pattern)) goto out; - ctx = strdup(context_str(my_tmp)); + ctx = context_to_str(my_tmp); if (!ctx) goto out; diff --git a/mcstrans/src/mcstrans.c b/mcstrans/src/mcstrans.c index 7667e131..f18f9da9 100644 --- a/mcstrans/src/mcstrans.c +++ b/mcstrans/src/mcstrans.c @@ -925,7 +925,7 @@ new_context_str(const char *incon, const char *range) { goto exit; } context_range_set(con, range); - rcon = strdup(context_str(con)); + rcon = context_to_str(con); context_free(con); if (!rcon) { goto exit; -- 2.47.2