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 569720 - objects/Jackson/domain.c:395: Memory leak: s
objects/Jackson/domain.c:395: Memory leak: s
Status: RESOLVED FIXED
Product: dia
Classification: Other
Component: general
devel
Other All
: Normal normal
: ---
Assigned To: Dia maintainers
Dia maintainers
Depends on:
Blocks:
 
 
Reported: 2009-01-29 20:36 UTC by aggro
Modified: 2009-01-30 17:22 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description aggro 2009-01-29 20:36:42 UTC
In file objects/Jackson/domain.c:395
Variable "s" allocated memory with g_strdup() but doesn't release it with g_free(). 

  switch (box->domkind) {
    case DOMAIN_CAUSAL:   s=g_strdup("C"); break;
    case DOMAIN_BIDDABLE: s=g_strdup("B"); break;
    case DOMAIN_LEXICAL:  s=g_strdup("L"); break;
    default: s=NULL;
  }

  if (s!=NULL) {
    renderer_ops->draw_rect(renderer, &b3, &b1, &JACKSON_BOX_FG_COLOR);
    renderer_ops->draw_string(renderer, &(*s), &b2, ALIGN_RIGHT, &box->text->color);
  }

This bug was found using cppcheck: http://cppcheck.wiki.sourceforge.net/
Comment 1 Hans Breuer 2009-01-30 17:22:42 UTC
2009-01-30  Hans Breuer  <hans@breuer.org>

	* objects/Jackson/domain.c : remove superfluous allocation to avoid
	leaking it, fixes bug #569720