Skip to content

Commit

Permalink
Go back to using Newx/Safefree
Browse files Browse the repository at this point in the history
This was originally done to support 5.6 which is no longer an issue.
Newx/Safefree is the recommended XS approach.
  • Loading branch information
JRaspass committed Nov 3, 2021
1 parent 844817b commit 8883471
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Fast.xs
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ _new(class, conf)
PREINIT:
Cache_Memcached_Fast *memd;
CODE:
memd = (Cache_Memcached_Fast *) malloc(sizeof(Cache_Memcached_Fast));
Newx(memd, 1, Cache_Memcached_Fast);
memd->c = client_init();
if (! memd->c)
croak("Not enough memory");
Expand Down Expand Up @@ -692,7 +692,7 @@ _destroy(memd)
SvREFCNT_dec(memd->deserialize_method);
}
SvREFCNT_dec(memd->servers);
free(memd);
Safefree(memd);


void
Expand Down

0 comments on commit 8883471

Please sign in to comment.