diff options
author | Valery Febvre <vfebvre at easter-eggs.com> | 2004-08-21 17:09:20 +0000 |
---|---|---|
committer | Valery Febvre <vfebvre at easter-eggs.com> | 2004-08-21 17:09:20 +0000 |
commit | 87e3c2dbfc60a82b6d4b48f2bc2b4f34e3c6abad (patch) | |
tree | bf4515f4bd33ccc7f4ec41d11e799623e9ae7f42 /lasso/Attic/protocols/federation.c | |
parent | 43bc1026787c4ec45ed6943ae08d9764496a0124 (diff) | |
download | lasso-87e3c2dbfc60a82b6d4b48f2bc2b4f34e3c6abad.tar.gz lasso-87e3c2dbfc60a82b6d4b48f2bc2b4f34e3c6abad.tar.xz lasso-87e3c2dbfc60a82b6d4b48f2bc2b4f34e3c6abad.zip |
Added checks not to do copies of NULL objects.
Diffstat (limited to 'lasso/Attic/protocols/federation.c')
-rw-r--r-- | lasso/Attic/protocols/federation.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/lasso/Attic/protocols/federation.c b/lasso/Attic/protocols/federation.c index bcdb6cde..800a24ff 100644 --- a/lasso/Attic/protocols/federation.c +++ b/lasso/Attic/protocols/federation.c @@ -79,7 +79,7 @@ lasso_federation_dump(LassoFederation *federation) federation->remote_providerID); /* add the remote name identifier */ - if(federation->remote_nameIdentifier) { + if(federation->remote_nameIdentifier != NULL) { nameIdentifier = lasso_node_new(); class = LASSO_NODE_GET_CLASS(nameIdentifier); class->set_name(nameIdentifier, LASSO_FEDERATION_REMOTE_NAME_IDENTIFIER_NODE); @@ -91,7 +91,7 @@ lasso_federation_dump(LassoFederation *federation) } /* add the local name identifier */ - if(federation->local_nameIdentifier) { + if(federation->local_nameIdentifier != NULL) { nameIdentifier = lasso_node_new(); class = LASSO_NODE_GET_CLASS(nameIdentifier); class->set_name(nameIdentifier, LASSO_FEDERATION_LOCAL_NAME_IDENTIFIER_NODE); @@ -111,13 +111,23 @@ lasso_federation_dump(LassoFederation *federation) LassoNode * lasso_federation_get_local_nameIdentifier(LassoFederation *federation) { - return(lasso_node_copy(federation->local_nameIdentifier)); + if (federation->local_nameIdentifier != NULL) { + return (lasso_node_copy(federation->local_nameIdentifier)); + } + else { + return (NULL); + } } LassoNode * lasso_federation_get_remote_nameIdentifier(LassoFederation *federation) { - return(lasso_node_copy(federation->remote_nameIdentifier)); + if (federation->remote_nameIdentifier != NULL) { + return(lasso_node_copy(federation->remote_nameIdentifier)); + } + else { + return (NULL); + } } void |