fix malloc bug
authorAleš Křenek <ljocha@ics.muni.cz>
Mon, 1 Aug 2005 12:18:52 +0000 (12:18 +0000)
committerAleš Křenek <ljocha@ics.muni.cz>
Mon, 1 Aug 2005 12:18:52 +0000 (12:18 +0000)
org.glite.jp.primary/src/authz.c

index 8ff2b58..edaaef4 100644 (file)
@@ -68,7 +68,7 @@ int glite_jpps_readauth(glite_jp_context_t ctx,const char *file)
                        return glite_jp_stack_error(ctx,&err);
                }
 
-               ctx->trusted_peers = realloc(ctx->trusted_peers, (cnt+1) * sizeof *ctx->trusted_peers);
+               ctx->trusted_peers = realloc(ctx->trusted_peers, (cnt+2) * sizeof *ctx->trusted_peers);
                ctx->trusted_peers[cnt++] = strdup(buf);
                ctx->trusted_peers[cnt] = NULL;
        }