nevermind, i already figured it out.

The free(result) function was causing it.