I would try
Vec *vec_new() {
Vec * new_struct = malloc(sizeof(struct Vec));
if (new_struct != NULL){
new_struct -> data = malloc(sizeof(int));
if(new_struct -> data == NULL){
free(new_struct);
return false;
}
new_struct -> length = 0;
new_struct -> capacity = 1;
}else{
free(new_struct);
}
return new_struct;
}