mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-07-28 01:41:48 +03:00
examples: Avoid using uninitialized memory
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Norbert Pocs <norbertpocs0@gmail.com>
This commit is contained in:
@ -8,7 +8,7 @@
|
|||||||
int main(void) {
|
int main(void) {
|
||||||
ssh_session session;
|
ssh_session session;
|
||||||
ssh_channel channel;
|
ssh_channel channel;
|
||||||
char buffer[1024*1024];
|
char buffer[1024 * 1024] = {0};
|
||||||
int rc;
|
int rc;
|
||||||
uint64_t total=0;
|
uint64_t total=0;
|
||||||
uint64_t lastshown=4096;
|
uint64_t lastshown=4096;
|
||||||
@ -47,7 +47,7 @@ int main(void) {
|
|||||||
if(total > LIMIT)
|
if(total > LIMIT)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
printf("error : %s\n",ssh_get_error(session));
|
printf("error : %s\n",ssh_get_error(session));
|
||||||
ssh_channel_close(channel);
|
ssh_channel_close(channel);
|
||||||
|
Reference in New Issue
Block a user