X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_chkpt_stores.h;h=61115a47243998119fff5f79a06b2b57381c440a;hb=b8fb74a295ebc2697876ac81f2b00628503a3822;hp=3c2572b8a695255af6beb11959429b52ec6ca161;hpb=46255dee5894bc5e3be5f54a5866c0c4b30b3896;p=palacios.releases.git diff --git a/palacios/src/palacios/vmm_chkpt_stores.h b/palacios/src/palacios/vmm_chkpt_stores.h index 3c2572b..61115a4 100644 --- a/palacios/src/palacios/vmm_chkpt_stores.h +++ b/palacios/src/palacios/vmm_chkpt_stores.h @@ -223,9 +223,23 @@ static void * dir_open_ctx(void * store_data, ctx = V3_Malloc(sizeof(struct file_ctx)); + + if (!ctx) { + PrintError("Cannot allocate\n"); + return NULL; + } + memset(ctx, 0, sizeof(struct file_ctx)); ctx->filename = V3_Malloc(strlen(url) + strlen(name) + 5); + + if (!ctx->filename) { + PrintError("Cannot allocate\n"); + V3_Free(ctx); + return -1; + } + + memset(ctx->filename, 0, strlen(url) + strlen(name) + 5); snprintf(ctx->filename, strlen(url) + strlen(name) + 5, "%s/%s", url, name);