]> Chaos Git - corbenik/ctrulib.git/commitdiff
Fix for issue #66
authorSlashmolder <Slashmolder@gmail.com>
Tue, 30 Dec 2014 23:30:44 +0000 (15:30 -0800)
committerSlashmolder <Slashmolder@gmail.com>
Tue, 30 Dec 2014 23:39:26 +0000 (15:39 -0800)
libctru/source/services/httpc.c

index a9f1eb9582ab33ff9c622cced80756927cbb4130..abeb98922b3b49e2c2be3637fa63ab5990869fdf 100644 (file)
@@ -43,8 +43,8 @@ Result httpcOpenContext(httpcContext *context, char* url, u32 use_defaultproxy)
 
        ret = HTTPC_InitializeConnectionSession(context->servhandle, context->httphandle);
        if(ret!=0) {
-               HTTPC_CloseContext(__httpc_servhandle, context->httphandle);
                svcCloseHandle(context->servhandle);
+               HTTPC_CloseContext(__httpc_servhandle, context->httphandle);
                return ret;
         }
 
@@ -52,8 +52,8 @@ Result httpcOpenContext(httpcContext *context, char* url, u32 use_defaultproxy)
 
        ret = HTTPC_SetProxyDefault(context->servhandle, context->httphandle);
        if(ret!=0) {
-               HTTPC_CloseContext(__httpc_servhandle, context->httphandle);
                svcCloseHandle(context->servhandle);
+               HTTPC_CloseContext(__httpc_servhandle, context->httphandle);
                return ret;
         }
 
@@ -64,8 +64,8 @@ Result httpcCloseContext(httpcContext *context)
 {
        Result ret=0;
 
-       ret = HTTPC_CloseContext(context->servhandle, context->httphandle);
        svcCloseHandle(context->servhandle);
+       ret = HTTPC_CloseContext(__httpc_servhandle, context->httphandle);
 
        return ret;
 }