Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: bindkey resource leak
- X-seq: zsh-workers 26024
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxxxxx>
- Subject: PATCH: bindkey resource leak
- Date: Tue, 11 Nov 2008 17:31:42 +0100
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.uk; h=Received:X-YMail-OSG:X-Yahoo-Newman-Property:Received:From:To:Subject:Date:Message-ID; b=ccVdbCzfI6PNllze4Hivr1AqEAxVgSl67+MONcIrIBu4G8XFWnGQqzLp1kva8uUWnD0+n2V2y7QlY6NTA6R6EvQdsEYwSs/RU386PlUbmeQqXIWiYerfLK6jjV+pkvTfQ4KN9zJH6ilqONopYywfqy98rhvqY1B8l8G0YSaxE4M= ;
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
Either of these run repeatedly will increment the reference counter for
the "thingy". The first case is CID 107. I don't think coverity picked
up on the second case.
bindkey -R B-A thingy
bindkey '' thingy
Oliver
Index: Src/Zle/zle_keymap.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_keymap.c,v
retrieving revision 1.29
diff -u -r1.29 zle_keymap.c
--- Src/Zle/zle_keymap.c 3 Apr 2008 15:20:24 -0000 1.29
+++ Src/Zle/zle_keymap.c 11 Nov 2008 16:17:43 -0000
@@ -918,11 +918,12 @@
metafy(m, 1, META_NOALLOC);
bindkey(km, m, refthingy(fn), str);
}
- unrefthingy(fn);
}
+ unrefthingy(fn);
} else {
if(bindkey(km, seq, fn, str)) {
zwarnnam(name, "cannot bind to an empty key sequence");
+ unrefthingy(fn);
ret = 1;
}
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author