Original ticket http://projects.scipy.org/numpy/ticket/572 on 2007-08-24 by @cournape, assigned to unknown.
The function _insert has a memory leak, and this shows when using for example cdf functions of distributions classes in scipy.stats (see scipy #1074).
The fix is trivial: just call Py_DECREF on ainput in rank 0 case, as in general case (the attached patch avoids separate code path for memory cleaning instead).