Skip to content

Commit

Permalink
drivers/snmp-ups.c: fix the dangling pointer warning some compilers h…
Browse files Browse the repository at this point in the history
…ave found [networkupstools#823]
  • Loading branch information
jimklimov committed Oct 2, 2023
1 parent db66837 commit 7c9405c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/snmp-ups.c
Original file line number Diff line number Diff line change
Expand Up @@ -1783,6 +1783,8 @@ void su_alarm_set(snmp_info_t *su_info_p, long value)
if ((info_value = su_find_infoval(su_info_p->oid2info, &value)) != NULL
&& info_value[0] != 0)
{
char alarm_info_value_more[SU_LARGEBUF + 32]; /* can sprintf() SU_LARGEBUF plus markup into here */

/* Special handling for outlet & outlet groups alarms */
if ((su_info_p->flags & SU_OUTLET)
|| (su_info_p->flags & SU_OUTLET_GROUP)) {
Expand All @@ -1803,7 +1805,6 @@ void su_alarm_set(snmp_info_t *su_info_p, long value)
* start of path */
if (info_type[0] == 'L') {
/* Extract phase number */
char alarm_info_value_more[SU_LARGEBUF + 32]; /* can sprintf() SU_LARGEBUF plus markup into here */

item_number = atoi(info_type+1);

Expand Down

0 comments on commit 7c9405c

Please sign in to comment.