Branch: Tag:

2005-12-29

2005-12-29 23:38:16 by Martin Nilsson <mani@lysator.liu.se>

malloc review

Rev: src/post_modules/GTK2/source/gdkgc.pre:1.3
Rev: src/post_modules/GTK2/source/gdkpixbuf.pre:1.8
Rev: src/post_modules/GTK2/source/gdkrectangle.pre:1.4
Rev: src/post_modules/GTK2/source/gladexml.pre:1.6
Rev: src/post_modules/GTK2/source/global.pre:1.6
Rev: src/post_modules/GTK2/source/gnomecanvas.pre:1.5
Rev: src/post_modules/GTK2/source/gobject.pre:1.5
Rev: src/post_modules/GTK2/source/gtkdatabox.pre:1.4
Rev: src/post_modules/GTK2/source/gtkliststore.pre:1.6
Rev: src/post_modules/GTK2/source/gtksourceiter.pre:1.4
Rev: src/post_modules/GTK2/source/gtksourcelanguage.pre:1.4
Rev: src/post_modules/GTK2/source/gtksourcestylescheme.pre:1.3
Rev: src/post_modules/GTK2/source/gtksourcetag.pre:1.3
Rev: src/post_modules/GTK2/source/gtktextbuffer.pre:1.6
Rev: src/post_modules/GTK2/source/gtktextiter.pre:1.7
Rev: src/post_modules/GTK2/source/gtktreemodel.inc:1.5
Rev: src/post_modules/GTK2/source/gtktreestore.pre:1.6

71:    len=MAX(a1->size,a2->size);    dw->X=(gfloat *)g_malloc(sizeof(gfloat)*len);    dw->Y=(gfloat *)g_malloc(sizeof(gfloat)*len); -  if (dw->X==NULL || dw->Y==NULL) +  if (dw->X==NULL || dw->Y==NULL) { +  if(dw->X) g_free(dw->X); +  g_free(dw);    SIMPLE_OUT_OF_MEMORY_ERROR("data_add",sizeof(gfloat)*len*2); -  +  }    for (i=0; i<len; i++) {    dw->X[i]=pgtk_get_float(ITEM(a1)+i);    dw->Y[i]=pgtk_get_float(ITEM(a2)+i);