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:
Holger Hans Peter Freyther 2011-07-19 17:59:00 +02:00
parent cae1b7c960
commit b4fc89bfcf
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}