Skip to content

Commit a2ba2b8

Browse files
Fix wolfSSHD_ConfigCopy and wolfSSHD_ConfigFree
1 parent 91cbb64 commit a2ba2b8

1 file changed

Lines changed: 28 additions & 2 deletions

File tree

apps/wolfsshd/configuration.c

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,30 @@ static WOLFSSHD_CONFIG* wolfSSHD_ConfigCopy(WOLFSSHD_CONFIG* conf)
277277
newConf->heap);
278278
}
279279

280+
if (ret == WS_SUCCESS && conf->hostCertFile) {
281+
ret = CreateString(&newConf->hostCertFile, conf->hostCertFile,
282+
(int)WSTRLEN(conf->hostCertFile),
283+
newConf->heap);
284+
}
285+
286+
if (ret == WS_SUCCESS && conf->pidFile) {
287+
ret = CreateString(&newConf->pidFile, conf->pidFile,
288+
(int)WSTRLEN(conf->pidFile),
289+
newConf->heap);
290+
}
291+
292+
if (ret == WS_SUCCESS && conf->userCAKeysFile) {
293+
ret = CreateString(&newConf->userCAKeysFile, conf->userCAKeysFile,
294+
(int)WSTRLEN(conf->userCAKeysFile),
295+
newConf->heap);
296+
}
297+
298+
if (ret == WS_SUCCESS && conf->forceCmd) {
299+
ret = CreateString(&newConf->forceCmd, conf->forceCmd,
300+
(int)WSTRLEN(conf->forceCmd),
301+
newConf->heap);
302+
}
303+
280304
if (ret == WS_SUCCESS) {
281305
newConf->loginTimer = conf->loginTimer;
282306
newConf->port = conf->port;
@@ -310,8 +334,10 @@ void wolfSSHD_ConfigFree(WOLFSSHD_CONFIG* conf)
310334
FreeString(&current->listenAddress, heap);
311335
FreeString(&current->authKeysFile, heap);
312336
FreeString(&current->hostKeyFile, heap);
313-
FreeString(&current->hostCertFile, heap);
314-
FreeString(&current->pidFile, heap);
337+
FreeString(&current->hostCertFile, heap);
338+
FreeString(&current->pidFile, heap);
339+
FreeString(&current->userCAKeysFile, heap);
340+
FreeString(&current->forceCmd, heap);
315341

316342
WFREE(current, heap, DYNTYPE_SSHD);
317343
current = next;

0 commit comments

Comments
 (0)