[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
shishi/lib crypto-ctx.c
From: |
shishi-commit |
Subject: |
shishi/lib crypto-ctx.c |
Date: |
Sun, 19 Oct 2003 21:41:32 -0400 |
CVSROOT: /cvsroot/shishi
Module name: shishi
Branch:
Changes by: Simon Josefsson <address@hidden> 03/10/19 21:41:32
Modified files:
lib : crypto-ctx.c
Log message:
Don't free(NULL).
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/shishi/shishi/lib/crypto-ctx.c.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
Patches:
Index: shishi/lib/crypto-ctx.c
diff -u shishi/lib/crypto-ctx.c:1.4 shishi/lib/crypto-ctx.c:1.5
--- shishi/lib/crypto-ctx.c:1.4 Sun Sep 28 19:38:02 2003
+++ shishi/lib/crypto-ctx.c Sun Oct 19 21:41:32 2003
@@ -103,7 +103,7 @@
const char *in, size_t inlen,
char **out, size_t * outlen)
{
- char *ivout;
+ char *ivout = NULL;
size_t ivoutlen;
int rc;
@@ -113,7 +113,8 @@
in, inlen, out, outlen);
if (rc == SHISHI_OK)
{
- free (ctx->iv);
+ if (ctx->iv)
+ free (ctx->iv);
ctx->iv = ivout;
ctx->ivlen = ivoutlen;
}
@@ -144,7 +145,7 @@
const char *in, size_t inlen,
char **out, size_t * outlen)
{
- char *ivout;
+ char *ivout = NULL;
size_t ivoutlen;
int rc;
@@ -154,7 +155,8 @@
in, inlen, out, outlen);
if (rc == SHISHI_OK)
{
- free (ctx->iv);
+ if (ctx->iv)
+ free (ctx->iv);
ctx->iv = ivout;
ctx->ivlen = ivoutlen;
}
@@ -172,6 +174,7 @@
shishi_crypto_close (Shishi_crypto * ctx)
{
shishi_key_done (ctx->key);
- free (ctx->iv);
+ if (ctx->iv)
+ free (ctx->iv);
free (ctx);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- shishi/lib crypto-ctx.c,
shishi-commit <=