Enlightenment CVS committal Author : xcomputerman Project : e17 Module : libs/ecore
Dir : e17/libs/ecore/src/lib/ecore_x Modified Files: ecore_x_window_prop.c Log Message: Off-by-one array size is an unnecessary leak. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_x/ecore_x_window_prop.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -3 -r1.30 -r1.31 --- ecore_x_window_prop.c 7 Feb 2004 11:01:48 -0000 1.30 +++ ecore_x_window_prop.c 7 Feb 2004 11:20:48 -0000 1.31 @@ -965,7 +965,7 @@ ecore_x_window_prop_property_get(win, _ecore_x_atom_net_wm_state, XA_ATOM, 32, &old_data, &num); oldset = (Atom *) old_data; - newset = calloc(num + 2, sizeof(Atom)); + newset = calloc(num + 1, sizeof(Atom)); if (!newset) return; data = (unsigned char *) newset; @@ -1057,7 +1057,7 @@ ecore_x_window_prop_property_get(win, _ecore_x_atom_net_wm_state, XA_ATOM, 32, &old_data, &num); oldset = (Atom *) old_data; - newset = calloc(num, sizeof(Atom)); + newset = calloc(num - 1, sizeof(Atom)); data = (unsigned char *) newset; for (i = 0; i < num; ++i) if (oldset[i] != state) ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ enlightenment-cvs mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs