* THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <stdlib.h>
#include <syslog.h>
#include <stdio.h>
#include <string.h>
log_init(const char *ident, int target, int syslog_facility)
{
+ free(log_config_ident);
log_config_ident = strdup(ident);
if (log_config_ident == NULL) {
if (log_config_target & LOG_TARGET_SYSLOG) {
closelog();
}
+
+ free(log_config_ident);
+ log_config_ident = NULL;
}
void
log_set_target(int target, int syslog_facility)
{
- log_close();
+ if (log_config_target & LOG_TARGET_SYSLOG) {
+ closelog();
+ }
log_config_target = target;
log_config_syslog_facility = syslog_facility;