diff --git a/oc2/ocinternal.c b/oc2/ocinternal.c index 81953140f..5d2118a07 100644 --- a/oc2/ocinternal.c +++ b/oc2/ocinternal.c @@ -191,6 +191,9 @@ ocopen(OCstate** statep, const char* url) #endif if(statep) *statep = state; + else { + if(state != NULL) ocfree(state); + } return OCTHROW(stat); fail: