From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <14103261a9b76e26bd8bff97afbaa1ef@lsub.org> To: 9fans@cse.psu.edu From: "Fco. J. Ballesteros" Date: Thu, 26 May 2005 12:32:07 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: [9fans] stringwidth leak or ignorance? Topicbox-Message-UUID: 55523338-ead0-11e9-9d60-3106f5b1d025 Hi, I've seen that at point sys/src/libdraw/stringwidth.c:46 45 if(subfontname){ >46 if(_getsubfont(f->display, subfontname) == 0){ 47 def = f->display->defaultfont; 48 if(def && f!=def) 49 f = def; 50 else 51 break; there seems to be a leak. _getsubfont returns a Subfont, which is not freed. However, there seems to be some side effect, because if I free the subfont, the routine breaks. This came from using leak on a program using stringwidth a lot. The program shows leaks that come from this point. So I tried to fix it. I still don't know enough of font handling to propose a course of action. Any suggestion? If I come up with a fix, I'll send a patch anyway. thanks