From 85f537b1be685506992924ad1752a65f5e155230 Mon Sep 17 00:00:00 2001 From: colophonium <> Date: Wed, 29 Jan 2025 17:08:12 +0000 Subject: [PATCH] Fix librdf_new_storage_with_options when options is NULL --- src/rdf_storage.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/rdf_storage.c b/src/rdf_storage.c index e38e406b..58b19ee9 100644 --- a/src/rdf_storage.c +++ b/src/rdf_storage.c @@ -580,9 +580,20 @@ librdf_new_storage_with_options(librdf_world *world, return NULL; } - options_hash=librdf_new_hash_from_hash(options); - if(!options_hash) - return NULL; + if (options) { + options_hash=librdf_new_hash_from_hash(options); + if(!options_hash) + return NULL; + } else { + options_hash=librdf_new_hash(world, NULL); + if(!options_hash) + return NULL; + + if(librdf_hash_open(options_hash, NULL, 0, 1, 1, NULL)) { + librdf_free_hash(options_hash); + return NULL; + } + } if(librdf_hash_open(options_hash, NULL, 0, 1, 1, NULL)) { librdf_free_hash(options_hash);