found memory leak in code

Bug #812975 reported by utnubu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Unity
Invalid
Undecided
Unassigned
unity (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

I think I found a memory leak in the code ./unity-4.2.0/plugins/unityshell/src/unity-util-accessible.cpp

At line 270 AtkKeyEventStruct *atk_event = g_new0 (AtkKeyEventStruct, 1); is allocated, but at line 290 the function returns a NULL pointer but does free atk_event first.

Possibly fixed with g_free(atk_event); after line 289 just before the NULL return?

Hope this is a useful report.

Revision history for this message
utnubu (cplanken) wrote :

sorry typo:
line 290 the function returns a NULL pointer but does free atk_event first.

should be

line 290 the function returns a NULL pointer but does NOT free atk_event first.

solly!

Revision history for this message
Harry van Haaren (harryhaaren) wrote :

I'll mark as confirmed.
Please note that posting on a mailing list or IRC is a *much* better and faster way to get these kind of changes upstream.
See http://unity.ubuntu.com/getinvolved/ or alternatively http://unity.ubuntu.com/contact-us/ for details. Thanks

Changed in unity:
status: New → Confirmed
Changed in unity (Ubuntu):
status: New → Confirmed
Revision history for this message
utnubu (cplanken) wrote :
Revision history for this message
Omer Akram (om26er) wrote :

that's probably not the case now. Can you confirm in 12.04?

Changed in unity:
status: Confirmed → Incomplete
Changed in unity (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
utnubu (cplanken) wrote :

Confirmed, fixed in 12.04 code.

But "I" did find new potential problems. I used the 'cppcheck' tool for this. Defenitly try it sometime, it looks only at code syntax, but can detect allot. apt-get install cppcheck 'flawfinder' is another nice tool for syntax checking.

Revision history for this message
Omer Akram (om26er) wrote :

closed. feel free to report any other bugs you may find.

Changed in unity (Ubuntu):
status: Incomplete → Invalid
Changed in unity:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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