sockstat: fix core dump
The get_proto_type function is used before creating the Casper function. This is why we have to distinguish when the Casper service is allocated or not. Reported by: olivier@ Tested by: olivier@
This commit is contained in:
parent
7bd295750b
commit
bfb5947bb1
@ -163,7 +163,10 @@ get_proto_type(const char *proto)
|
||||
|
||||
if (strlen(proto) == 0)
|
||||
return (0);
|
||||
pent = cap_getprotobyname(capnetdb, proto);
|
||||
if (capnetdb != NULL)
|
||||
pent = cap_getprotobyname(capnetdb, proto);
|
||||
else
|
||||
pent = getprotobyname(proto);
|
||||
if (pent == NULL) {
|
||||
warn("cap_getprotobyname");
|
||||
return (-1);
|
||||
|
Loading…
Reference in New Issue
Block a user