Bug 879402 - Fix possible leak in createArray and make it work for ggc, r=bhackett