From 0bb6e0b11cf2fda4ecdb89a6407d919c6ed328f5 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 12 Oct 2016 12:18:18 +0200 Subject: Remove superfluous context null checks. Code MUST pass a non-null context to all functions. Checking ctx for null and failing silently is no more useful than segfaulting. fz_keep_imp and fz_drop_imp handle NULL pointers safely, so the NULL checks for this can also be dropped at the same time. --- source/gprf/gprf-doc.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'source/gprf') diff --git a/source/gprf/gprf-doc.c b/source/gprf/gprf-doc.c index 8d6b3b32..9f9d5ebb 100644 --- a/source/gprf/gprf-doc.c +++ b/source/gprf/gprf-doc.c @@ -88,18 +88,12 @@ fz_new_gprf_file(fz_context *ctx, char *filename) static gprf_file * fz_keep_gprf_file(fz_context *ctx, gprf_file *file) { - if (!ctx || !file) - return NULL; - return fz_keep_imp(ctx, file, &file->refs); } static void fz_drop_gprf_file(fz_context *ctx, gprf_file *file) { - if (!ctx || !file) - return; - if (fz_drop_imp(ctx, file, &file->refs)) { unlink(file->filename); -- cgit v1.2.3