From 80638ec73168cfb34176cdea540864c0117fc905 Mon Sep 17 00:00:00 2001 From: Thomas Nilefalk Date: Wed, 27 Nov 2024 13:32:28 +0100 Subject: [PATCH] [memory] Start of refactoring away olxc-memory allocation --- src/TODO.org | 2 +- src/cxref.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/TODO.org b/src/TODO.org index 2623e90a..57f603aa 100644 --- a/src/TODO.org +++ b/src/TODO.org @@ -17,7 +17,7 @@ Some useful commands: There are a *lot* of things to do to make c-xref into modern and maintainable C. - +* DOING Refactor to remove olcx-memory allocation from memory.c * TODO FEATURE: New refactoring: move function for C ** DONE Pick-up pieces from Java version and hack them into a preliminary version ** DONE Accept target position diff --git a/src/cxref.c b/src/cxref.c index 6a0a732a..96c2cb13 100644 --- a/src/cxref.c +++ b/src/cxref.c @@ -37,11 +37,12 @@ int olcxReferenceInternalLessFunction(Reference *r1, Reference *r2) { static void renameCollationSymbols(SymbolsMenu *menu) { int len,len1; - char *nn, *cs; + char *cs; assert(menu); for (SymbolsMenu *m=menu; m!=NULL; m=m->next) { cs = strchr(m->references.linkName, LINK_NAME_COLLATE_SYMBOL); if (cs!=NULL && m->references.type==TypeCppCollate) { + char *nn; len = strlen(m->references.linkName); assert(len>=2); nn = olcxAlloc(len-1);