summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-12-16 17:00:39 +0100
committerDavid Robillard <d@drobilla.net>2020-12-16 17:00:39 +0100
commitff24f14c0971f1fcbbb061bbedbd384874ed3957 (patch)
tree549c82bbce1a3d2a5c67b56502f0ae092f6f9a61
parent206c176beaa21295bc2aca06da0d75a34924fef4 (diff)
downloadlilv-ff24f14c0971f1fcbbb061bbedbd384874ed3957.tar.gz
lilv-ff24f14c0971f1fcbbb061bbedbd384874ed3957.tar.bz2
lilv-ff24f14c0971f1fcbbb061bbedbd384874ed3957.zip
Fix potential null dereference
-rw-r--r--src/state.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/state.c b/src/state.c
index a1c5d3c..914ff5b 100644
--- a/src/state.c
+++ b/src/state.c
@@ -1301,7 +1301,9 @@ lilv_state_delete(LilvWorld* world,
// Remove state file
const uint8_t* uri = sord_node_get_string(file);
char* path = (char*)serd_file_uri_parse(uri, NULL);
- try_unlink(state->dir, path);
+ if (path) {
+ try_unlink(state->dir, path);
+ }
serd_free(path);
}