Re: y.a. static code analysis

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Noticed and reported by Serhat Şevki Dinçer.

Signed-off-by: Alex Riesen <raa.lkml@xxxxxxxxx>
---

Alex Riesen, Sun, May 24, 2009 15:04:06 +0200:
> 2009/5/23 Serhat Şevki Dinçer <jfcgauss@xxxxxxxxx>:
> 
> > [./http-push.c:1419]: (error) Using 'lock' after it is deallocated / released
> 
> This is the only real bug.
> 

Here's a fix.

 http-push.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/http-push.c b/http-push.c
index dac2c6e..45e8a69 100644
--- a/http-push.c
+++ b/http-push.c
@@ -1415,8 +1415,9 @@ static void remove_locks(void)
 
 	fprintf(stderr, "Removing remote locks...\n");
 	while (lock) {
+		struct remote_lock *next = lock->next;
 		unlock_remote(lock);
-		lock = lock->next;
+		lock = next;
 	}
 }
 
-- 
1.6.3.1.93.g316b2



--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]