from
perldoc perlguts
To free an SV that you've created, call "SvREFCNT_dec(SV*)". Norma
+lly
this call is not necessary (see "Reference Counts and Mortality").
You do not free SV, you decrement its usage, and, when refcount goes to zero, it will be destroyed, and may be some destruction-time action will be activated
addition to free memory out from external library, consult that library's logic. Perl do not uses external char*, it will copy its data into newly created SV
Best regards,
Courage, the Cowardly Dog