From d6dc50d0196244bf1c8ffd316247977a762c1d51 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Wed, 12 Jul 2023 11:39:03 -0400 Subject: [PATCH] MT#55283 silence compiler warning g_string_free(..., FALSE) is declared as warn_unused_result closes #1690 Change-Id: Ib0a7fb4eab4359226fba519cfd485fb3228a0bc7 (cherry picked from commit 37d7762fec353e62117e7bdd1d4d404f474e9771) --- daemon/sdp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/daemon/sdp.c b/daemon/sdp.c index 29812e68b..174153f9b 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -2031,8 +2031,9 @@ void sdp_chopper_destroy(struct sdp_chopper *chop) { void sdp_chopper_destroy_ret(struct sdp_chopper *chop, str *ret) { *ret = STR_NULL; if (chop->output) { - str_init_len(ret, chop->output->str, chop->output->len); - g_string_free(chop->output, FALSE); + size_t len = chop->output->len; + char *str = g_string_free(chop->output, FALSE); + str_init_len(ret, str, len); chop->output = NULL; } sdp_chopper_destroy(chop);