Skip to content

Commit 72998a5

Browse files
committed
misc correctness cleanups
1 parent 345591f commit 72998a5

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

src/routes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4625,7 +4625,7 @@ WOLFSENTRY_API wolfsentry_errcode_t wolfsentry_route_render(WOLFSENTRY_CONTEXT_A
46254625
}
46264626
}
46274627

4628-
wolfsentry_route_render_proto(r->sa_proto, r->flags, f);
4628+
WOLFSENTRY_RERETURN_IF_ERROR(wolfsentry_route_render_proto(r->sa_proto, r->flags, f));
46294629

46304630
if (r->parent_event != NULL) {
46314631
if (fprintf(f, ", ev = \"%.*s\"%s", (int)r->parent_event->label_len, r->parent_event->label, WOLFSENTRY_CHECK_BITS(r->flags, WOLFSENTRY_ROUTE_FLAG_PARENT_EVENT_WILDCARD) ? "[*]" : "") < 0)
@@ -4728,7 +4728,7 @@ WOLFSENTRY_API wolfsentry_errcode_t wolfsentry_route_exports_render(WOLFSENTRY_C
47284728
}
47294729
}
47304730

4731-
wolfsentry_route_render_proto(r->sa_proto, r->flags, f);
4731+
WOLFSENTRY_RERETURN_IF_ERROR(wolfsentry_route_render_proto(r->sa_proto, r->flags, f));
47324732

47334733
if (r->parent_event_label_len > 0) {
47344734
if (fprintf(f, ", ev = \"%.*s\"%s", (int)r->parent_event_label_len, r->parent_event_label, WOLFSENTRY_CHECK_BITS(r->flags, WOLFSENTRY_ROUTE_FLAG_PARENT_EVENT_WILDCARD) ? "[*]" : "") < 0)

src/wolfsentry_util.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -666,9 +666,9 @@ static void *wolfsentry_builtin_realloc(
666666
#ifdef WOLFSENTRY_MALLOC_DEBUG
667667
{
668668
void *ret = realloc(ptr, size);
669-
if ((ptr == null) && (ret != NULL))
669+
if ((ptr == NULL) && (ret != NULL))
670670
WOLFSENTRY_ATOMIC_INCREMENT(n_mallocs, 1);
671-
else if ((ptr != null) && (ret == NULL))
671+
else if ((ptr != NULL) && (ret == NULL))
672672
WOLFSENTRY_ATOMIC_DECREMENT(n_mallocs, 1);
673673
return ret;
674674
}
@@ -1775,7 +1775,6 @@ WOLFSENTRY_API wolfsentry_errcode_t wolfsentry_lock_destroy(struct wolfsentry_rw
17751775
(lock->read_waiter_count != 0) ||
17761776
(lock->write_waiter_count != 0) ||
17771777
(lock->read2write_waiter_read_count != 0) ||
1778-
(lock->read2write_reservation_holder != WOLFSENTRY_THREAD_NO_ID) ||
17791778
(lock->promoted_at_count != 0))
17801779
{
17811780
WOLFSENTRY_WARN("attempt to destroy lock with corrupted state {%u,%d,%d,%d,%d,%d,%d}\n", (unsigned int)lock->state, lock->holder_count.read, lock->read_waiter_count, lock->write_waiter_count, lock->read2write_waiter_read_count, lock->read2write_reservation_holder != WOLFSENTRY_THREAD_NO_ID, lock->promoted_at_count);

0 commit comments

Comments
 (0)