Fix CID 10743: Unchecked return value

https://fedorahosted.org/freeipa/ticket/2036
This commit is contained in:
Simo Sorce 2011-11-03 10:05:21 -04:00
parent e615bea1be
commit 7cca50e9b5

View File

@ -504,9 +504,15 @@ free_and_return:
/* Either this is the same pointer that we allocated and set above,
* or whoever used it should have freed it and allocated a new
* value that we need to free here */
slapi_pblock_get(pb, SLAPI_ORIGINAL_TARGET, &dn);
ret = slapi_pblock_get(pb, SLAPI_ORIGINAL_TARGET, &dn);
if (ret) {
LOG_TRACE("Failed to get SLAPI_ORIGINAL_TARGET\n");
}
slapi_ch_free_string(&dn);
slapi_pblock_set(pb, SLAPI_ORIGINAL_TARGET, NULL);
ret = slapi_pblock_set(pb, SLAPI_ORIGINAL_TARGET, NULL);
if (ret) {
LOG_TRACE("Failed to clear SLAPI_ORIGINAL_TARGET\n");
}
slapi_ch_free_string(&authmethod);
slapi_ch_free_string(&principal);