From e09fffd37e2ece404800044c853a42f5ebed9493 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 13 Aug 2012 02:07:05 +0000 Subject: Fix potential crash when state saving fails. git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@4676 a436a847-0d15-0410-975c-d299462d15a1 --- src/state.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/state.c') diff --git a/src/state.c b/src/state.c index c1ff6c0..5b7b64b 100644 --- a/src/state.c +++ b/src/state.c @@ -385,10 +385,11 @@ lilv_state_new_from_instance(const LilvPlugin* plugin, free(state->props); state->props = NULL; state->num_props = 0; + } else { + qsort(state->props, state->num_props, sizeof(Property), property_cmp); } } - qsort(state->props, state->num_props, sizeof(Property), property_cmp); qsort(state->values, state->num_values, sizeof(PortValue), value_cmp); free(sfeatures); -- cgit v1.2.1