Re: y.a. static code analysis
Noticed and reported by Serhat Şevki Dinçer.
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
Alex Riesen, Sun, May 24, 2009 15:04:06 +0200:
Show 6 quoted lines
> 2009/5/23 Serhat Şevki Dinçer <jfcgauss@gmail.com>:
>
> > [./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