Optimized memory allocation when processing libs
[fw/sdcc] / as / mcs51 / lklibr.c
index 2fe35be5729d2ff62a9035198e1a33aa8b2ccfd5..9f3df0d91a88d9c1e898bdde46a71da2b958b452 100644 (file)
@@ -383,9 +383,6 @@ search()
                        }
                }
        }
-#ifdef INDEXLIB
-    freelibraryindex();
-#endif
 }
 
 /*Load a .rel file embedded in a sdcclib file*/
@@ -1261,6 +1258,9 @@ library()
                        loadfile_SdccLib(lbfh->libspc, lbfh->relfil, lbfh->offset);
                }
        }
+#ifdef INDEXLIB
+    freelibraryindex();
+#endif
 }
 
 /*)Function    VOID    loadfile(filspc)