Fix for plugin leak.

As long as the `result` is assigned to a `script variable` the arrays
will not leak anymore.

If the function is only called in a loop within assigning it, it will
still leak the resulting array. But who does that anyway??