diff --git a/src/util.c b/src/util.c index 320d2e8a..53a6f59a 100644 --- a/src/util.c +++ b/src/util.c @@ -820,7 +820,7 @@ unsigned char *convert_utf8_to_gsm_best_lang(const char *utf8, long len, items_written, terminator, locking, single); if (encoded != NULL) - return encoded; + goto out; if (hint == GSM_DIALECT_DEFAULT) return NULL; @@ -830,7 +830,7 @@ unsigned char *convert_utf8_to_gsm_best_lang(const char *utf8, long len, items_written, terminator, locking, single); if (encoded != NULL) - return encoded; + goto out; /* Spanish dialect uses the default locking shift table */ if (hint == GSM_DIALECT_SPANISH) @@ -844,6 +844,7 @@ unsigned char *convert_utf8_to_gsm_best_lang(const char *utf8, long len, if (encoded == NULL) return NULL; +out: if (used_locking != NULL) *used_locking = locking;