]> granicus.if.org Git - ejabberd/commitdiff
Make sure that res is initialized in all cases
authorPaweł Chmielowski <pchmielowski@process-one.net>
Fri, 6 Apr 2012 10:00:43 +0000 (12:00 +0200)
committerPaweł Chmielowski <pchmielowski@process-one.net>
Fri, 6 Apr 2012 10:00:43 +0000 (12:00 +0200)
src/tls/tls_drv.c

index d0774684cc7160800912903fb6bbb572fe07137e..6dbdccbe931d9d733f9ad6b1df6e209a69e10051 100644 (file)
@@ -443,6 +443,8 @@ static ErlDrvSSizeT tls_drv_control(ErlDrvData handle,
            b = driver_alloc_binary(size);
            b->orig_bytes[0] = 0;
 
+           res = 0;
+
            while ((req_size == 0 || rlen < req_size + 1) &&
                   (res = SSL_read(d->ssl,
                                   b->orig_bytes + rlen,