BUG: Fix memory leak.
BUG: Fix memory leak.

Patch is from Julian Taylor. Closes #4652.

drasmuss/numpy,rgommers/numpy,jonathanunderwood/numpy,nguyentu1602/numpy,jakirkham/numpy,joferkington/numpy,SunghanKim/numpy,dimasad/numpy,gmcastil/numpy,tynn/numpy,rherault-insa/numpy,skymanaditya1/numpy,jschueller/numpy,mwiebe/numpy,nguyentu1602/numpy,AustereCuriosity/numpy,ajdawson/numpy,mindw/numpy,rajathkumarmp/numpy,charris/numpy,KaelChen/numpy,behzadnouri/numpy,rajathkumarmp/numpy,nguyentu1602/numpy,tacaswell/numpy,tynn/numpy,dch312/numpy,SunghanKim/numpy,larsmans/numpy,Yusa95/numpy,Dapid/numpy,mattip/numpy,argriffing/numpy,kiwifb/numpy,stuarteberg/numpy,pbrod/numpy,numpy/numpy,chiffa/numpy,cjermain/numpy,jorisvandenbossche/numpy,jschueller/numpy,has2k1/numpy,Dapid/numpy,cowlicks/numpy,ssanderson/numpy,pyparallel/numpy,shoyer/numpy,rhythmsosad/numpy,solarjoe/numpy,ContinuumIO/numpy,endolith/numpy,ESSS/numpy,GaZ3ll3/numpy,githubmlai/numpy,pdebuyl/numpy,pdebuyl/numpy,ChanderG/numpy,MichaelAquilina/numpy,pdebuyl/numpy,utke1/numpy,kiwifb/numpy,rgommers/numpy,utke1/numpy,mattip/numpy,andsor/numpy,ahaldane/numpy,tacaswell/numpy,jorisvandenbossche/numpy,rhythmsosad/numpy,madphysicist/numpy,WillieMaddox/numpy,jakirkham/numpy,charris/numpy,WarrenWeckesser/numpy,grlee77/numpy,ssanderson/numpy,mortada/numpy,BMJHayward/numpy,mhvk/numpy,andsor/numpy,charris/numpy,SunghanKim/numpy,bmorris3/numpy,dimasad/numpy,MichaelAquilina/numpy,ahaldane/numpy,pizzathief/numpy,ajdawson/numpy,mortada/numpy,WarrenWeckesser/numpy,madphysicist/numpy,yiakwy/numpy,mwiebe/numpy,naritta/numpy,larsmans/numpy,stuarteberg/numpy,ViralLeadership/numpy,bertrand-l/numpy,sigma-random/numpy,tacaswell/numpy,Yusa95/numpy,SiccarPoint/numpy,grlee77/numpy,chiffa/numpy,sigma-random/numpy,pbrod/numpy,empeeu/numpy,mathdd/numpy,jankoslavic/numpy,githubmlai/numpy,cowlicks/numpy,mattip/numpy,musically-ut/numpy,sinhrks/numpy,mingwpy/numpy,tdsmith/numpy,Eric89GXL/numpy,jorisvandenbossche/numpy,rudimeier/numpy,rmcgibbo/numpy,stuarteberg/numpy,kiwifb/numpy,sonnyhu/numpy,dato-code/numpy,Srisai85/numpy,bmorris3/numpy,BMJHayward/numpy,ChristopherHogan/numpy,abalkin/numpy,mindw/numpy,bringingheavendown/numpy,grlee77/numpy,gfyoung/numpy,yiakwy/numpy,shoyer/numpy,trankmichael/numpy,CMartelLML/numpy,anntzer/numpy,jonathanunderwood/numpy,drasmuss/numpy,hainm/numpy,jankoslavic/numpy,jorisvandenbossche/numpy,cowlicks/numpy,ekalosak/numpy,chatcannon/numpy,ViralLeadership/numpy,madphysicist/numpy,BMJHayward/numpy,BMJHayward/numpy,dch312/numpy,rmcgibbo/numpy,moreati/numpy,seberg/numpy,empeeu/numpy,dimasad/numpy,GaZ3ll3/numpy,skwbc/numpy,sigma-random/numpy,ahaldane/numpy,Eric89GXL/numpy,mhvk/numpy,sonnyhu/numpy,sinhrks/numpy,skymanaditya1/numpy,brandon-rhodes/numpy,sonnyhu/numpy,GrimDerp/numpy,shoyer/numpy,andsor/numpy,simongibbons/numpy,numpy/numpy,GrimDerp/numpy,Dapid/numpy,nbeaver/numpy,bringingheavendown/numpy,solarjoe/numpy,jschueller/numpy,gmcastil/numpy,abalkin/numpy,KaelChen/numpy,pizzathief/numpy,dimasad/numpy,MaPePeR/numpy,simongibbons/numpy,leifdenby/numpy,SiccarPoint/numpy,brandon-rhodes/numpy,sinhrks/numpy,simongibbons/numpy,MaPePeR/numpy,shoyer/numpy,njase/numpy,GaZ3ll3/numpy,SiccarPoint/numpy,trankmichael/numpy,ChristopherHogan/numpy,bringingheavendown/numpy,bmorris3/numpy,ssanderson/numpy,b-carter/numpy,numpy/numpy,joferkington/numpy,yiakwy/numpy,tynn/numpy,anntzer/numpy,naritta/numpy,groutr/numpy,tdsmith/numpy,pbrod/numpy,b-carter/numpy,seberg/numpy,BabeNovelty/numpy,skymanaditya1/numpy,kirillzhuravlev/numpy,pdebuyl/numpy,yiakwy/numpy,ContinuumIO/numpy,ChanderG/numpy,ddasilva/numpy,jankoslavic/numpy,shoyer/numpy,mhvk/numpy,NextThought/pypy-numpy,Anwesh43/numpy,drasmuss/numpy,Linkid/numpy,rajathkumarmp/numpy,brandon-rhodes/numpy,dwillmer/numpy,ekalosak/numpy,jorisvandenbossche/numpy,MaPePeR/numpy,cjermain/numpy,madphysicist/numpy,mingwpy/numpy,dwillmer/numpy,pyparallel/numpy,chatcannon/numpy,trankmichael/numpy,MaPePeR/numpy,dwillmer/numpy,Yusa95/numpy,maniteja123/numpy,dch312/numpy,endolith/numpy,WillieMaddox/numpy,rajathkumarmp/numpy,MichaelAquilina/numpy,MSeifert04/numpy,kirillzhuravlev/numpy,BabeNovelty/numpy,tdsmith/numpy,has2k1/numpy,mhvk/numpy,ViralLeadership/numpy,ddasilva/numpy,musically-ut/numpy,mindw/numpy,naritta/numpy,Yusa95/numpy,moreati/numpy,dch312/numpy,dato-code/numpy,grlee77/numpy,joferkington/numpy,anntzer/numpy,ContinuumIO/numpy,rherault-insa/numpy,seberg/numpy,WarrenWeckesser/numpy,MSeifert04/numpy,leifdenby/numpy,kirillzhuravlev/numpy,CMartelLML/numpy,AustereCuriosity/numpy,rhythmsosad/numpy,b-carter/numpy,empeeu/numpy,ddasilva/numpy,felipebetancur/numpy,Linkid/numpy,pbrod/numpy,tdsmith/numpy,mathdd/numpy,empeeu/numpy,cowlicks/numpy,Anwesh43/numpy,BabeNovelty/numpy,dwillmer/numpy,ChristopherHogan/numpy,ekalosak/numpy,githubmlai/numpy,AustereCuriosity/numpy,ESSS/numpy,solarjoe/numpy,CMartelLML/numpy,rgommers/numpy,skwbc/numpy,jakirkham/numpy,ChanderG/numpy,Linkid/numpy,jakirkham/numpy,charris/numpy,mindw/numpy,bertrand-l/numpy,ekalosak/numpy,abalkin/numpy,KaelChen/numpy,brandon-rhodes/numpy,mingwpy/numpy,njase/numpy,pizzathief/numpy,groutr/numpy,mhvk/numpy,groutr/numpy,Eric89GXL/numpy,GaZ3ll3/numpy,MSeifert04/numpy,pyparallel/numpy,chiffa/numpy,ahaldane/numpy,musically-ut/numpy,jonathanunderwood/numpy,GrimDerp/numpy,NextThought/pypy-numpy,gfyoung/numpy,rudimeier/numpy,ahaldane/numpy,bertrand-l/numpy,felipebetancur/numpy,sigma-random/numpy,NextThought/pypy-numpy,has2k1/numpy,joferkington/numpy,skymanaditya1/numpy,njase/numpy,larsmans/numpy,utke1/numpy,MichaelAquilina/numpy,seberg/numpy,numpy/numpy,felipebetancur/numpy,Eric89GXL/numpy,hainm/numpy,argriffing/numpy,KaelChen/numpy,SunghanKim/numpy,larsmans/numpy,anntzer/numpy,WarrenWeckesser/numpy,andsor/numpy,simongibbons/numpy,cjermain/numpy,madphysicist/numpy,WarrenWeckesser/numpy,sinhrks/numpy,Srisai85/numpy,rhythmsosad/numpy,gmcastil/numpy,leifdenby/numpy,hainm/numpy,sonnyhu/numpy,MSeifert04/numpy,mortada/numpy,naritta/numpy,maniteja123/numpy,NextThought/pypy-numpy,rudimeier/numpy,mathdd/numpy,rherault-insa/numpy,SiccarPoint/numpy,bmorris3/numpy,Srisai85/numpy,nguyentu1602/numpy,mattip/numpy,pizzathief/numpy,stuarteberg/numpy,kirillzhuravlev/numpy,mortada/numpy,GrimDerp/numpy,endolith/numpy,Anwesh43/numpy,felipebetancur/numpy,ajdawson/numpy,jakirkham/numpy,behzadnouri/numpy,behzadnouri/numpy,rmcgibbo/numpy,trankmichael/numpy,rudimeier/numpy,pbrod/numpy,Srisai85/numpy,maniteja123/numpy,rmcgibbo/numpy,jankoslavic/numpy,ChristopherHogan/numpy,chatcannon/numpy,Anwesh43/numpy,BabeNovelty/numpy,mwiebe/numpy,ESSS/numpy,cjermain/numpy,simongibbons/numpy,musically-ut/numpy,dato-code/numpy,rgommers/numpy,grlee77/numpy,dato-code/numpy,argriffing/numpy,MSeifert04/numpy,hainm/numpy,skwbc/numpy,WillieMaddox/numpy,moreati/numpy,nbeaver/numpy,ajdawson/numpy,ChanderG/numpy,mathdd/numpy,endolith/numpy,githubmlai/numpy,nbeaver/numpy,jschueller/numpy,gfyoung/numpy,Linkid/numpy,has2k1/numpy,pizzathief/numpy,mingwpy/numpy,CMartelLML/numpy