auth: token jar handling should realloc correctly

instead of reallocing n+1 tokens, we would realloc 1 token
plus N bytes

Change-Id: Idb5a20b5b9becc9d48cb645bbc0bd26459220ccd
Reviewed-on: http://gerrit.openafs.org/8163
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
This commit is contained in:
Derrick Brashear 2012-09-26 07:37:11 -04:00
parent 5538633c9f
commit a060159b95

View File

@ -174,7 +174,7 @@ addOpaque(struct ktc_setTokenData *jar, char *data, size_t len)
entry = jar->tokens.tokens_len;
jar->tokens.tokens_val = realloc(jar->tokens.tokens_val,
entry + 1 * sizeof(token_opaque));
(entry + 1) * sizeof(token_opaque));
jar->tokens.tokens_len++;
jar->tokens.tokens_val[entry].token_opaque_val = data;
jar->tokens.tokens_val[entry].token_opaque_len = len;