projects
/
platform
/
core
/
multimedia
/
libmm-utility.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove out of memory related code by using glib APIs
[platform/core/multimedia/libmm-utility.git]
/
imgp
/
test
/
mm_util_imgp_testsuite.c
diff --git
a/imgp/test/mm_util_imgp_testsuite.c
b/imgp/test/mm_util_imgp_testsuite.c
index
7f1b654
..
7589011
100644
(file)
--- a/
imgp/test/mm_util_imgp_testsuite.c
+++ b/
imgp/test/mm_util_imgp_testsuite.c
@@
-96,13
+96,7
@@
static gboolean _read_file(char *path, void **data, size_t *length)
}
rewind(fp);
}
rewind(fp);
- *data = (void *)calloc(1, len);
- if (*data == NULL) {
- fprintf(stderr, "\tmemory allocation failed \n");
- fclose(fp);
- return FALSE;
- }
-
+ *data = g_malloc0(len);
*length = fread(*data, 1, (size_t)len, fp);
if (*length != len) {
fprintf(stderr, "\t[IMGP_testsuite] fread failed \n");
*length = fread(*data, 1, (size_t)len, fp);
if (*length != len) {
fprintf(stderr, "\t[IMGP_testsuite] fread failed \n");
@@
-110,11
+104,6
@@
static gboolean _read_file(char *path, void **data, size_t *length)
fclose(fp);
fclose(fp);
- if (*data == NULL) {
- *length = 0;
- return FALSE;
- }
-
*length = (size_t)len;
fprintf(stderr, "\t[IMGP_testsuite] %s %zu read DONE\n", path, *length);
*length = (size_t)len;
fprintf(stderr, "\t[IMGP_testsuite] %s %zu read DONE\n", path, *length);