From 8b3d4eff9342de812d0d27759beeff5e4e7532d1 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 12 May 2013 12:33:49 +0200 Subject: [PATCH] dbwrap: Fix CID 1002092 Uninitialized scalar variable We don't set saved_errno in the ret==0 case. Signed-off-by: Volker Lendecke Reviewed-by: Ira Cooper --- lib/dbwrap/dbwrap_ntdb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/dbwrap/dbwrap_ntdb.c b/lib/dbwrap/dbwrap_ntdb.c index 5be7b842e21..658c4873410 100644 --- a/lib/dbwrap/dbwrap_ntdb.c +++ b/lib/dbwrap/dbwrap_ntdb.c @@ -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; } -- 2.34.1