After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 564916 - objects/SISSI/sissi_object.c:369: Memory leak: file_name
objects/SISSI/sissi_object.c:369: Memory leak: file_name
Status: RESOLVED FIXED
Product: dia
Classification: Other
Component: general
devel
Other All
: Normal normal
: 0.97
Assigned To: Dia maintainers
Dia maintainers
Depends on:
Blocks:
 
 
Reported: 2008-12-17 20:32 UTC by aggro
Modified: 2009-01-02 14:12 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description aggro 2008-12-17 20:32:25 UTC
In file objects/SISSI/sissi_object.c:369: 
Variable file_name leaks memory:

  file_name= g_strdup(object_sissi->file); /* this line could add url of file to the dia_get_data_directory() function */
  object_sissi->image = dia_image_load(dia_get_data_directory(object_sissi->file));
  
  object_sissi_update_data(object_sissi, ANCHOR_MIDDLE, ANCHOR_MIDDLE);

  return &object_sissi->element.object;
}

This bug was found using cppcheck: http://cppcheck.wiki.sourceforge.net/
Comment 1 Sameer D. Sahasrabuddhe 2008-12-26 21:04:06 UTC
Fixed by a patch in bug 565720.
Comment 2 Hans Breuer 2009-01-02 14:12:25 UTC
2009-01-02  Hans Breuer  <hans@breuer.org>

	Patch from Sameer D. Sahasrabuddhe fixing bug #565720
	En passant fixing bug #564799 and bug #564916
	* objects/SISSI/sissi.[ch] : introduced a new local function that 
	returns the correct sheets directory for SISSI
	* objects/SISSI/site.c objects/SISSI/faraday.c objects/SISSI/area.c
	  objects/SISSI/room.c objects/SISSI/sissi_object.c : use it
	* sheets/SISSI/*.xml : relative path removed from 
	<sissi:attribute name="file_image"/>

	* app/create_object.c : don't crash if object creation fails
	(bug #565567,  Sameer D. Sahasrabuddhe)