summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (from parent 1: 3f171ca)
raw | patch | inline | side by side (from parent 1: 3f171ca)
author | Falk Tristram <falk.tristram@cognex.com> | |
Fri, 26 May 2017 15:23:54 +0000 (10:23 -0500) | ||
committer | Angela Stegmaier <angelabaker@ti.com> | |
Fri, 26 May 2017 20:42:03 +0000 (15:42 -0500) |
Initialize mutex_attr before using it. Otherwise, it could
contain some uninitialized values.
Also, initialize nsMsg to zero before using it.
Signed-off-by: Falk Tristram <falk.tristram@cognex.com>
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
contain some uninitialized values.
Also, initialize nsMsg to zero before using it.
Signed-off-by: Falk Tristram <falk.tristram@cognex.com>
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
linux/src/daemon/NameServer_daemon.c | patch | blob | history |
index c1a58f08e31184fb634ea3868bfc7a92e945d564..f7982c799642ac78a0b51ccaa5c7ca9686ef719e 100644 (file)
{
NameServer_Handle handle = NULL;
pthread_mutexattr_t mutex_attr;
+ Int status = 0;
assert(params != NULL);
assert(name != NULL);
pthread_mutex_lock(&NameServer_module->modGate);
+ status = pthread_mutexattr_init(&mutex_attr);
+ assert(status == 0);
+
/* check if the name is already created or not */
handle = NameServer_getHandle(name);
if (handle != NULL) {
handle = NULL;
leave:
+ pthread_mutexattr_destroy(&mutex_attr);
pthread_mutex_unlock(&NameServer_module->modGate);
return (handle);
LOG1("NameServer_getRemote: Sending request via sock: %d\n", sock)
+ memset(&nsMsg, 0, sizeof(NameServerRemote_Msg));
/* Create request message and send to remote processor: */
nsMsg.reserved = NAMESERVER_MSG_TOKEN;
nsMsg.request = NAMESERVER_REQUEST;