From a7fb4262597c07ca5da9709df75a2007b92b222b Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Sat, 1 Jan 2011 23:51:18 +0000 Subject: [PATCH] rx: Don't crash when emptying an empty identity In common with our other freeContents functions, freeing the contents of a structure which is already empty shouldn't crash. Change-Id: I93b54c0e450d2184c10575b50dadfd1471d43289 Reviewed-on: http://gerrit.openafs.org/3606 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- src/rx/rx_identity.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/rx/rx_identity.c b/src/rx/rx_identity.c index 7f50ed038e..514d97be59 100644 --- a/src/rx/rx_identity.c +++ b/src/rx/rx_identity.c @@ -164,8 +164,11 @@ rx_identity_new(rx_identity_kind kind, char *displayName, void *enameData, void rx_identity_freeContents(struct rx_identity *identity) { - rxi_Free(identity->displayName, strlen(identity->displayName)); - identity->displayName = NULL; + if (identity->displayName) { + rxi_Free(identity->displayName, strlen(identity->displayName)); + identity->displayName = NULL; + } + rx_opaque_freeContents(&identity->exportedName); }