Commits

Anonymous committed a619a61

added reverselist; free recycling bin on error exit

Comments (0)

Files changed (1)

Objects/listobject.c

 	else { /* Insert d items; recycle ihigh-ilow items */
 		RESIZE(item, object *, a->ob_size + d);
 		if (item == NULL) {
+			XDEL(recycle);
 			err_nomem();
 			return -1;
 		}
 }
 
 int
+reverselist(v)
+	object *v;
+{
+	if (v == NULL || !is_listobject(v)) {
+		err_badcall();
+		return -1;
+	}
+	v = listreverse((listobject *)v, (object *)NULL);
+	if (v == NULL)
+		return -1;
+	DECREF(v);
+	return 0;
+}
+
+int
 sortlist(v)
 	object *v;
 {