dbwrap: Fix CID 1002092 Uninitialized scalar variable
authorVolker Lendecke <vl@samba.org>
Sun, 12 May 2013 10:33:49 +0000 (12:33 +0200)
committerVolker Lendecke <vl@samba.org>
Sun, 12 May 2013 13:56:08 +0000 (15:56 +0200)
We don't set saved_errno in the ret==0 case.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
lib/dbwrap/dbwrap_ntdb.c

index 5be7b842e2183dce5dba713c0e1baef25bdb081b..658c48734106b5e2da6f888e3b48f8a00b02ee51 100644 (file)
@@ -326,7 +326,9 @@ static int timeout_lock(int fd, int rw, off_t off, off_t len, bool waitflag,
        }
 
        alarm(0);
-       errno = saved_errno;
+       if (ret != 0) {
+               errno = saved_errno;
+       }
        return ret;
 }