if (r_type == CTSVC_RECORD_PERSON) {
unsigned int *project = malloc(sizeof(unsigned int)*ids_count);
+ if (project == NULL){
+ ERR("Memory Allocation Failed");
+ ctsvc_stmt_finalize(stmt);
+ contacts_list_destroy(list, true);
+ return CONTACTS_ERROR_OUT_OF_MEMORY;
+ }
+
for (i = 0; i < ids_count; i++)
project[i] = properties[i].property_id;
ids_count = s_query->projection_count;
project = malloc(sizeof(unsigned int)*ids_count);
+ if (project == NULL){
+ ERR("Memory Allocation failed");
+ ctsvc_stmt_finalize(stmt);
+ contacts_list_destroy(list, true);
+ return CONTACTS_ERROR_OUT_OF_MEMORY;
+ }
for (i = 0; i < ids_count; i++) {
if (0 == s_query->projection_count)