// opening shm for this file
i->shm = cserve2_shm_request(i->file->w * i->file->h * 4);
+ if (!i->shm)
+ return NULL;
shmpath = cserve2_shm_name_get(i->shm);
ERR("file \"%s\" is in file_ids hash but not in entries hash.",
buf);
cserve2_client_error_send(client, rid, CSERVE2_INVALID_CACHE);
+ // FIXME: Maybe we should remove the entry from file_ids then?
return -1;
}
ref = _entry_reference_add((Entry *)entry, client, client_file_id);
return NULL;
}
+ shm = calloc(1, sizeof(Shm_Handle));
+ if (!shm)
+ {
+ ERR("Failed to allocate shared memory handler.");
+ free(map);
+ return NULL;
+ }
+
do {
snprintf(shmname, sizeof(shmname), "/evas-shm-img-%x-%d", (int)getuid(), id++);
fd = shm_open(shmname, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
{
ERR("Failed to create shared memory object '%s': %m", shmname);
free(map);
+ free(shm);
return NULL;
}
} while (fd == -1);
ERR("Failed to set size of shared file: %m");
close(fd);
free(map);
+ free(shm);
return NULL;
}
close(fd);
map->name = eina_stringshare_add(shmname);
map->length = map_size;
- shm = calloc(1, sizeof(Shm_Handle));
- if (!shm)
- {
- ERR("Failed to allocate shared memory handler.");
- eina_stringshare_del(map->name);
- free(map);
- return NULL;
- }
-
map->segments = eina_inlist_append(map->segments, EINA_INLIST_GET(shm));
shm->mapping = map;
shm->map_offset = 0;