# HG changeset patch # User Erik Quanstrom # Date 1323457348 28800 # Node ID afa3c6e9b9949f832665053c15b24a95dd8bb7d5 # Parent d1772e16b9f4b19e6a7a381ea0a4ccf189a4fe5a devssl: tiny fixes (from plan 9) - freeb blocks instead of freeing them. - smalloc instead of malloc with no check. (this is from plan 9 but done differently. plan 9 issues an error.) R=nixiedev, john CC=nix-dev http://codereview.appspot.com/5450087 Committer: John Floren diff -r d1772e16b9f4 -r afa3c6e9b994 sys/src/nix/port/devssl.c --- a/sys/src/nix/port/devssl.c Sat Dec 03 09:52:52 2011 +0100 +++ b/sys/src/nix/port/devssl.c Fri Dec 09 11:02:28 2011 -0800 @@ -761,7 +761,7 @@ if(waserror()){ if(b != nil) - free(b); + freeb(b); nexterror(); } @@ -893,7 +893,7 @@ key[6] &= 0x0f; } - w->state = malloc(sizeof(DESstate)); + w->state = smalloc(sizeof(DESstate)); if(w->slen >= 16) setupDESstate(w->state, key, w->secret+8); else if(w->slen >= 8) @@ -929,7 +929,7 @@ if(w->slen > 5) w->slen = 5; - w->state = malloc(sizeof(RC4state)); + w->state = smalloc(sizeof(RC4state)); setupRC4state(w->state, w->secret, w->slen); } @@ -948,7 +948,7 @@ if(w->slen > 16) w->slen = 16; - w->state = malloc(sizeof(RC4state)); + w->state = smalloc(sizeof(RC4state)); setupRC4state(w->state, w->secret, w->slen); }