summaryrefslogtreecommitdiffstats
path: root/backend_kodak1400.c
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2015-06-23 20:32:41 -0400
committerSolomon Peachy <pizza@shaftnet.org>2015-06-23 20:48:52 -0400
commit55ebb0bf1bf1b65b0b66e8412bdddefcfcf3d2d8 (patch)
tree7534aae0a07c7295cee3e042a7e442e528f3ec6a /backend_kodak1400.c
parentf9bedc6f903408d2cfb3d6e2fc3a2cd81ada974e (diff)
downloadselphy_print-55ebb0bf1bf1b65b0b66e8412bdddefcfcf3d2d8.tar.gz
selphy_print-55ebb0bf1bf1b65b0b66e8412bdddefcfcf3d2d8.tar.bz2
selphy_print-55ebb0bf1bf1b65b0b66e8412bdddefcfcf3d2d8.zip
all: Ensure all malloc() failures are caught and logged.
Diffstat (limited to 'backend_kodak1400.c')
-rw-r--r--backend_kodak1400.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/backend_kodak1400.c b/backend_kodak1400.c
index b865473..6c187dc 100644
--- a/backend_kodak1400.c
+++ b/backend_kodak1400.c
@@ -158,6 +158,11 @@ static int kodak1400_set_tonecurve(struct kodak1400_ctx *ctx, char *fname)
uint16_t *data = malloc(UPDATE_SIZE);
+ if (!data) {
+ ERROR("Memory Allocation Failure!\n");
+ return -1;
+ }
+
/* Read in file */
int tc_fd = open(fname, O_RDONLY);
if (tc_fd < 0) {
@@ -277,8 +282,10 @@ int kodak1400_cmdline_arg(void *vctx, int argc, char **argv)
static void *kodak1400_init(void)
{
struct kodak1400_ctx *ctx = malloc(sizeof(struct kodak1400_ctx));
- if (!ctx)
+ if (!ctx) {
+ ERROR("Memory Allocation Failure!\n");
return NULL;
+ }
memset(ctx, 0, sizeof(struct kodak1400_ctx));
return ctx;
@@ -596,7 +603,7 @@ top:
struct dyesub_backend kodak1400_backend = {
.name = "Kodak 1400/805",
- .version = "0.32",
+ .version = "0.33",
.uri_prefix = "kodak1400",
.cmdline_usage = kodak1400_cmdline,
.cmdline_arg = kodak1400_cmdline_arg,