Trim excess SDS allocation in inline command parsing

This commit is contained in:
Yangbo Long 2026-05-24 10:24:10 -04:00
parent 368786ead5
commit 24c18b1034

View file

@ -3127,6 +3127,8 @@ int processInlineBuffer(client *c, pendingCommand *pcmd) {
/* Create redis objects for all arguments. */
for (pcmd->argc = 0, j = 0; j < argc; j++) {
/* Trim greedy allocation from sdssplitargs(). */
argv[j] = sdsRemoveFreeSpace(argv[j], 0);
pcmd->argv[pcmd->argc] = createObject(OBJ_STRING,argv[j]);
pcmd->argc++;
pcmd->argv_len_sum += sdslen(argv[j]);