Project

General

Profile

Actions

Bug #4450

open

pointless condfree in libfmnotify

Added by Garrett D'Amore over 7 years ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
lib - userland libraries
Start date:
2014-01-10
Due date:
% Done:

0%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:

Description

In libfmnotify.c:

595static void
596condfree(void *buf)
597{
598 if (buf != NULL)
599 free(buf);
600}
601
602void
603nd_free_event_info(nd_ev_info_t *ev_info)
604{
605 condfree(ev_info->ei_severity);
606 condfree(ev_info->ei_descr);
607 condfree(ev_info->ei_diagcode);
608 condfree(ev_info->ei_url);
609 condfree(ev_info->ei_uuid);
610 condfree(ev_info->ei_fmri);
611 condfree(ev_info->ei_from_state);
612 condfree(ev_info->ei_to_state);
613 condfree(ev_info->ei_reason);
614 fmev_rele(ev_info->ei_ev);
615 free(ev_info);
616}

The use of condfree() is rather silly, since free already has the semantics that free(NULL) is a no-op. (The C standard requires this.)

This would be a nice simple integration for someone looking for a trivial bug to fix.

No data to display

Actions

Also available in: Atom PDF