mirror of https://gerrit.osmocom.org/osmo-pcap
smatch: Check the client->device variable
This is fixing: src/osmo_client_core.c +105 osmo_client_capture(8) warn: variable dereferenced before check 'client'
This commit is contained in:
parent
cae1b7c960
commit
b4fc89bfcf
|
@ -102,7 +102,7 @@ int osmo_client_capture(struct osmo_pcap_client *client, const char *device)
|
|||
free_all(client);
|
||||
|
||||
client->device = talloc_strdup(client, device);
|
||||
if (!client) {
|
||||
if (!client->device) {
|
||||
LOGP(DCLIENT, LOGL_ERROR, "Failed to copy string.\n");
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue