Browse Source

procd: Fix minor null pointer dereference.

Null pointer check was placed after assigning values to c.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Rosen Penev 6 years ago
parent
commit
6900a6be63
1 changed files with 3 additions and 3 deletions
  1. 3 3
      plug/hotplug.c

+ 3 - 3
plug/hotplug.c

@@ -392,12 +392,12 @@ static void queue_add(struct cmd_handler *h, struct blob_attr *msg, struct blob_
 		&_data, blob_pad_len(data),
 		NULL);
 
-	c->msg = _msg;
-	c->data = _data;
-
 	if (!c)
 		return;
 
+	c->msg = _msg;
+	c->data = _data;
+
 	memcpy(c->msg, msg, blob_pad_len(msg));
 	memcpy(c->data, data, blob_pad_len(data));
 	c->handler = h->handler;