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 <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
This commit is contained in:
Simon Wilkinson 2011-01-01 23:51:18 +00:00 committed by Jeffrey Altman
parent 616763cd07
commit a7fb426259

View File

@ -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);
}