summaryrefslogtreecommitdiff
path: root/examples/mrp_client
diff options
context:
space:
mode:
authorJean-Baptiste Maillet <jean-baptiste.maillet@parrot.com>2014-11-24 10:47:26 +0100
committerJean-Baptiste Maillet <jean-baptiste.maillet@parrot.com>2014-11-24 10:47:26 +0100
commit1a4bdbc2165a1a5d4136c53ff2a2b143029cdbdc (patch)
tree5a3a40421dad18ddb743dbfd4fd19319c1e74ac0 /examples/mrp_client
parentaa0e114ee47e02d4f0ffde3e0ed5836a7423d0f6 (diff)
downloadOpen-AVB-1a4bdbc2165a1a5d4136c53ff2a2b143029cdbdc.tar.gz
Fix for Coverity CID71769 - Dereference null return value
Diffstat (limited to 'examples/mrp_client')
-rwxr-xr-xexamples/mrp_client/mrpl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/mrp_client/mrpl.c b/examples/mrp_client/mrpl.c
index acfca00d..5297be2d 100755
--- a/examples/mrp_client/mrpl.c
+++ b/examples/mrp_client/mrpl.c
@@ -146,6 +146,10 @@ int main(int argc, char *argv[])
}
msgbuf = malloc(1500);
+ if (NULL == msgbuf) {
+ printf("malloc failed\n");
+ return -1;
+ }
memset(msgbuf, 0, 1500);
sprintf(msgbuf, "S+D:C=6,P=3,V=0002");
@@ -164,5 +168,4 @@ int main(int argc, char *argv[])
rc = mprdclient_sendto(msgbuf, 1500);
return (rc);
-
}