From d45ce10c836213052f78e7c0217c6f6a1202727e Mon Sep 17 00:00:00 2001 From: Antoni Bertolin Monferrer Date: Thu, 11 Dec 2025 21:42:16 +0100 Subject: [PATCH] channels: Fix OOM error check after strdup The fix allows the code to properly check if the strdup failed to allocate a char buffer for the exit signal. Signed-off-by: Antoni Bertolin Monferrer Reviewed-by: Jakub Jelen --- src/channels.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/channels.c b/src/channels.c index e9f57f88..42f6a2c5 100644 --- a/src/channels.c +++ b/src/channels.c @@ -3517,7 +3517,7 @@ int ssh_channel_get_exit_state(ssh_channel channel, *pexit_signal = NULL; if (channel->exit.signal != NULL) { *pexit_signal = strdup(channel->exit.signal); - if (pexit_signal == NULL) { + if (*pexit_signal == NULL) { ssh_set_error_oom(session); return SSH_ERROR; }