]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
lang_codes: fix lang_code_user() malloc
authorJaroslav Kysela <perex@perex.cz>
Tue, 6 Oct 2015 13:16:47 +0000 (15:16 +0200)
committerJaroslav Kysela <perex@perex.cz>
Tue, 6 Oct 2015 13:31:01 +0000 (15:31 +0200)
src/lang_codes.c

index ec9a7a68c4777e8ee190c7210f54f78d0908a831..f60d5b215a389fc9718b273cd175ce9d0d26a731 100644 (file)
@@ -705,7 +705,7 @@ char *lang_code_user( const char *ucode )
     return ucode ? strdup(ucode) : NULL;
   if (!ucode)
     return codes ? strdup(codes) : NULL;
-  ret = malloc(strlen(codes) + strlen(ucode ?: "") + 1);
+  ret = malloc(strlen(codes) + strlen(ucode ?: "") + 2);
   strcpy(ret, ucode);
   while (codes && *codes) {
     s = codes;