--- slpd/slpd_knownda.c.orig 2011-02-16 12:49:41.000000000 +0000 +++ slpd/slpd_knownda.c 2011-02-16 12:53:02.000000000 +0000 @@ -823,15 +823,15 @@ int SLPDKnownDAAdd(SLPMessage msg, SLPBu */ SLPDLogDAAdvertisement("Removed",entry); } + /* If we are here, we need to cleanup the message descriptor and the */ + /* message buffer because they were not added to the database and not */ + /* cleaning them up would result in a memory leak */ + SLPMessageFree(msg); + SLPBufferFree(buf); } CLEANUP: - /* If we are here, we need to cleanup the message descriptor and the */ - /* message buffer because they were not added to the database and not */ - /* cleaning them up would result in a memory leak */ /* We also need to make sure the Database handle is closed. */ - SLPMessageFree(msg); - SLPBufferFree(buf); if (dh) SLPDatabaseClose(dh); return result;