resolved: make check-pointer-deref clean
Add the needed assert changes to make the code clean for the new check-pointer-deref script.
This commit is contained in:
@@ -2985,7 +2985,6 @@ if spatch.found()
|
||||
'src/network/',
|
||||
'src/nspawn/',
|
||||
'src/nss-systemd/',
|
||||
'src/resolve/',
|
||||
'src/shared/',
|
||||
# libc/ has no assert() or systemd-headers so leave it
|
||||
'src/libc/',
|
||||
|
||||
@@ -48,7 +48,7 @@ REENABLE_WARNING;
|
||||
#if HAVE_OPENSSL
|
||||
|
||||
static int rr_compare(DnsResourceRecord * const *a, DnsResourceRecord * const *b) {
|
||||
const DnsResourceRecord *x = *a, *y = *b;
|
||||
const DnsResourceRecord *x = *ASSERT_PTR(a), *y = *ASSERT_PTR(b);
|
||||
size_t m;
|
||||
int r;
|
||||
|
||||
|
||||
@@ -81,6 +81,8 @@ int dns_stub_listener_extra_new(
|
||||
Manager *m,
|
||||
DnsStubListenerExtra **ret) {
|
||||
|
||||
assert(ret);
|
||||
|
||||
DnsStubListenerExtra *l;
|
||||
|
||||
l = new(DnsStubListenerExtra, 1);
|
||||
|
||||
@@ -332,6 +332,8 @@ int dnssd_txt_item_new_from_string(const char *key, const char *value, DnsTxtIte
|
||||
size_t length;
|
||||
DnsTxtItem *i;
|
||||
|
||||
assert(ret_item);
|
||||
|
||||
length = strlen(key);
|
||||
|
||||
if (!isempty(value))
|
||||
@@ -357,6 +359,8 @@ int dnssd_txt_item_new_from_data(const char *key, const void *data, const size_t
|
||||
size_t length;
|
||||
DnsTxtItem *i;
|
||||
|
||||
assert(ret_item);
|
||||
|
||||
length = strlen(key);
|
||||
|
||||
if (size > 0)
|
||||
|
||||
@@ -890,6 +890,7 @@ int link_address_new(Link *l,
|
||||
|
||||
assert(l);
|
||||
assert(in_addr);
|
||||
assert(in_addr_broadcast);
|
||||
|
||||
a = new(LinkAddress, 1);
|
||||
if (!a)
|
||||
|
||||
@@ -1464,6 +1464,8 @@ static int manager_next_random_name(const char *old, char **ret_new) {
|
||||
uint64_t u, a;
|
||||
char *n;
|
||||
|
||||
assert(ret_new);
|
||||
|
||||
p = strchr(old, 0);
|
||||
assert(p);
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
#include "tests.h"
|
||||
|
||||
static void dns_scope_freep(DnsScope **s) {
|
||||
POINTER_MAY_BE_NULL(s);
|
||||
|
||||
if (s != NULL && *s != NULL)
|
||||
dns_scope_free(*s);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user