X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_chkpt_stores.h;h=8feaf5a59a2adfd1008c92d4e65079e357ba6e0c;hb=c900a49cfd8ff982a35bb7385fbd927e961569a0;hp=3c2572b8a695255af6beb11959429b52ec6ca161;hpb=46255dee5894bc5e3be5f54a5866c0c4b30b3896;p=palacios.git diff --git a/palacios/src/palacios/vmm_chkpt_stores.h b/palacios/src/palacios/vmm_chkpt_stores.h index 3c2572b..8feaf5a 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 NULL; + } + + memset(ctx->filename, 0, strlen(url) + strlen(name) + 5); snprintf(ctx->filename, strlen(url) + strlen(name) + 5, "%s/%s", url, name);