Several potential bugs of memory leak in libx11-1.6.4

Bug #1940018 reported by yuxuan He
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libx11 (Ubuntu)
New
Undecided
Unassigned

Bug Description

Ubuntu version: 18.04
libx11 version:1.6.4
Hello,I found some potential bugs in package libx11-xcb-dev,and the microsoft word file in the attachment I uploaded shows the occurrence process of the bug in a graphical way.Would you help me check whether the bugs mentioned below are true? I'm not 100% sure that the bugs I submitted is correct. I hope you don't mind seeing the wrong bug I submitted.Thank you very much for your patience.

In file libx11-1.6.4/modules/im/ximcp/imLcPrs.c,defination of parsestringfile,line 734.
The statement "tbp=malloc(size);"allocate memory to tbp and in line 738,if select false branch at this statement,tbp will not be freed correctly.the process of this potential bug is shown in figure 1.

In file libx11-1.6.4/src/xlibi18n/lcDB.c,defination of f_numeric,line 882.
The statement "wordp=malloc(len+1);"allocate memory to wordp and in line 883,if select false branch at this statement,function f_numeric will go on to execute.In line 910 or line 915,if select false branch at this statement,wordp will not be freed correctly.the process of this potential bug is shown in figure 2.

In file libx11-1.6.4/src/xlibi18n/lcDB.c,defination of f_default,line 933.
The statement "wordp=malloc(len+1);"allocate memory to wordp and in line 934,if select false branch at this statement,function f_default will go on to execute.and if select true branch in line 938,flow goto err,In line 989,if select false branch here,wordp will not be freed correctly.the process of this potential bug is shown in figure 3.

Revision history for this message
yuxuan He (hyxl1017) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.