Wouldn't calling sv_grow() directly fix that?
In reply to Re^4: Perl XS: garbage-collecting my malloc'd buffer (sv_grow?) by tye in thread Perl XS: garbage-collecting my malloc'd buffer by edan