Blob Blame History Raw
It's just bad to de-couple state and NULL ptrs.

diff -Nur audacious-plugins-fedora-2.2-neon1/src/neon/neon.c audacious-plugins-fedora-2.2-neon2/src/neon/neon.c
--- audacious-plugins-fedora-2.2-neon1/src/neon/neon.c	2010-01-25 09:46:23.000000000 +0100
+++ audacious-plugins-fedora-2.2-neon2/src/neon/neon.c	2010-01-25 09:51:17.000000000 +0100
@@ -727,11 +727,13 @@
             _LEAVE 0;
         } else if (-1 == ret) {
             ne_session_destroy(handle->session);
+            handle->session = NULL;
             _LEAVE -1;
         }
 
         _DEBUG("<%p> Following redirect...", handle);
         ne_session_destroy(handle->session);
+        handle->session = NULL;
     }
 
     /*
@@ -945,7 +947,9 @@
     }
 
     _DEBUG("<%p> Destroying session", h);
-    ne_session_destroy(h->session);
+    if (NULL != h->session) {
+        ne_session_destroy(h->session);
+    }
 
     handle_free(h);
 
@@ -1359,7 +1363,10 @@
     if (NULL != h->request) {
         ne_request_destroy(h->request);
     }
-    ne_session_destroy(h->session);
+    if (NULL != h->session) {
+        ne_session_destroy(h->session);
+        h->session = NULL;
+    }
     reset_rb(&h->rb);
 
     if (0 != open_handle(h, newpos)) {