Coverity #1098778 fixed 12/18212/1
Dhruv Khattar [Fri, 3 Jun 2016 21:33:21 +0000 (02:33 +0530)]
Change-Id: I0c36abef692128814b6ba5931fcd564e5ebf22ca

scilab/modules/special_functions/sci_gateway/c/sci_legendre.c

index 2285673..a59287d 100644 (file)
@@ -219,7 +219,6 @@ int sci_legendre(char *fname, void* pvApiCtx)
         iRet = getAllocatedSingleString(pvApiCtx, piAddr4, &lschar);
         if (iRet)
         {
-            freeAllocatedSingleString(lschar);
             return iRet;
         }
 
@@ -231,6 +230,7 @@ int sci_legendre(char *fname, void* pvApiCtx)
         {
             normalized = 0;
         }
+        freeAllocatedSingleString(lschar);
     }
     else
     {