Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Paranoid error checking in userspace utils
[palacios.git] / linux_usr / v3_user_host_dev_example.c
index 833f3c5..4f8144e 100644 (file)
@@ -31,6 +31,10 @@ int do_work(struct palacios_host_dev_host_request_response *req,
     //
     // now built a response
     *resp = malloc(sizeof(struct palacios_host_dev_host_request_response) + datasize);
+    if (!*resp) {
+        fprintf(stderr, "ERROR: could not allocate memory for response\n");
+        return -1;
+    }
     (*resp)->data_len = sizeof(struct palacios_host_dev_host_request_response) + datasize;
 
     //