This case in the "dso_unload" handlers should not be reported as an error -
authorGeoff Thorpe <geoff@openssl.org>
Tue, 25 Apr 2000 08:37:12 +0000 (08:37 +0000)
committerGeoff Thorpe <geoff@openssl.org>
Tue, 25 Apr 2000 08:37:12 +0000 (08:37 +0000)
if a DSO_load(NULL,...) operation fails, it will have to call DSO_free() on
the DSO structure it created and that will filter through to this "unload"
call.

If the stack size is "< 1", then the library never actually loaded. To keep
things clean higher up, I'll treat this as a vacuous case without an error.
It makes the error stack easier to follow real world cases, and the error
this ignores was only useful for catching bugs in internal code, not
mismatched calls from applications (which should be handled in the generic
DSO layer).

crypto/dso/dso_dl.c
crypto/dso/dso_dlfcn.c
crypto/dso/dso_win32.c

index a4152e7723259423e1b08eda1539d1957bc72b08..bb808ad6fba7ec63fd5c1b903361f78d3d4f4ee9 100644 (file)
@@ -147,10 +147,7 @@ static int dl_unload(DSO *dso)
                return(0);
                }
        if(sk_num(dso->meth_data) < 1)
-               {
-               DSOerr(DSO_F_DL_UNLOAD,DSO_R_STACK_ERROR);
-               return(0);
-               }
+               return(1);
        /* Is this statement legal? */
        ptr = (shl_t)sk_pop(dso->meth_data);
        if(ptr == NULL)
index cad1aedd4edd163e53f3c611c377ef29e9965729..7638724f7810b083aa0e60795726b2806b6531c3 100644 (file)
@@ -152,10 +152,7 @@ static int dlfcn_unload(DSO *dso)
                return(0);
                }
        if(sk_num(dso->meth_data) < 1)
-               {
-               DSOerr(DSO_F_DLFCN_UNLOAD,DSO_R_STACK_ERROR);
-               return(0);
-               }
+               return(1);
        ptr = (void *)sk_pop(dso->meth_data);
        if(ptr == NULL)
                {
index edf5d75b0f6a7e78c9087ae457ededc9d605a03a..2b1ab2177d1059427d4aa76238ab8f0a05e6129a 100644 (file)
@@ -159,10 +159,7 @@ static int win32_unload(DSO *dso)
                return(0);
                }
        if(sk_num(dso->meth_data) < 1)
-               {
-               DSOerr(DSO_F_WIN32_UNLOAD,DSO_R_STACK_ERROR);
-               return(0);
-               }
+               return(1);
        p = (HINSTANCE *)sk_pop(dso->meth_data);
        if(p == NULL)
                {