summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjell Winblad <kjellwinblad@gmail.com>2021-03-17 14:53:17 +0100
committerKjell Winblad <kjellwinblad@gmail.com>2021-04-06 11:44:34 +0200
commit689397e0111d1751ddb38a67abd1fe75b4ecab83 (patch)
treeba3fea1bad8fc7494335b6f8e341084200ecf91b
parent1e3047c8f2f415e35f52312357c589d60495ae3d (diff)
downloaderlang-689397e0111d1751ddb38a67abd1fe75b4ecab83.tar.gz
erlexec.c: code_checker warning fix (strndup allocated string)
-rw-r--r--erts/etc/common/erlexec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/erts/etc/common/erlexec.c b/erts/etc/common/erlexec.c
index 2cb5b76cad..5656068db0 100644
--- a/erts/etc/common/erlexec.c
+++ b/erts/etc/common/erlexec.c
@@ -1200,7 +1200,9 @@ int main(int argc, char **argv)
if (flavor == NULL) {
flavor = type;
} else {
- currbuff += sprintf(currbuff,"-emu_type %s ", strndup(type,flavor - type));
+ char* emu_type = strndup(type,flavor - type);
+ currbuff += sprintf(currbuff,"-emu_type %s ", emu_type);
+ free(emu_type);
flavor++;
}
currbuff += sprintf(currbuff,"-emu_flavor %s", flavor);