mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-28 07:13:54 +09:00
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 <antoni.monferrer@canonical.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
committed by
Jakub Jelen
parent
a7fd80795e
commit
d45ce10c83
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user