libidav/session.c

changeset 790
7110b37f2a6b
parent 788
9b9420041d8e
child 796
81e0f67386a6
--- a/libidav/session.c	Thu Sep 14 18:11:50 2023 +0200
+++ b/libidav/session.c	Sun Sep 17 11:21:31 2023 +0200
@@ -302,8 +302,13 @@
     ssize_t i = cxListFind(sessions, sn);
     if(i >= 0) {
         cxListRemove(sessions, i);
+    } else {
+        printf("Error: session not found in ctx->sessions\n");
+        dav_session_destructor(sn);
     }
-    
+}
+
+void dav_session_destructor(DavSession *sn) {
     cxMempoolDestroy(sn->mp);
     curl_easy_cleanup(sn->handle);
     free(sn);

mercurial