diff options
-rw-r--r-- | erts/etc/common/erlexec.c | 4 |
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); |