Commit cdb5a8ba75dd6051eb9c0ff9d63c59ecb704f5bd
1 parent
01d88fa4
Exists in
master
and in
5 other branches
Corrigindo memory leak
Showing
3 changed files
with
7 additions
and
4 deletions
Show diff stats
src/lib3270/Makefile.in
... | ... | @@ -127,7 +127,7 @@ $(BINRLS)/@DLLPREFIX@3270@DLLEXT@: $(foreach SRC, $(basename $(SOURCES)), $(OBJR |
127 | 127 | $(BINDBG)/testprogram$(EXEEXT): $(OBJDBG)/testprogram.o $(foreach SRC, $(basename $(SOURCES)), $(OBJDBG)/$(SRC)@OBJEXT@) |
128 | 128 | @echo " CCLD `basename $@`" |
129 | 129 | @$(MKDIR) `dirname $@` |
130 | - $(LD) -o $@ $^ $(LIBS) | |
130 | + $(LD) -pthread -o $@ $^ $(LIBS) | |
131 | 131 | |
132 | 132 | $(DEBDIR)/lib3270.install: Makefile |
133 | 133 | @echo " GEN `basename $@`" | ... | ... |
src/lib3270/host.c
... | ... | @@ -474,9 +474,9 @@ split_success: |
474 | 474 | |
475 | 475 | static int do_connect(H3270 *hSession, const char *n) |
476 | 476 | { |
477 | - char nb[2048]; /* name buffer */ | |
478 | - char *s; /* temporary */ | |
479 | - const char *chost; /* to whom we will connect */ | |
477 | + char nb[2048]; /* name buffer */ | |
478 | + char *s; /* temporary */ | |
479 | + char *chost = NULL; /* to whom we will connect */ | |
480 | 480 | // char *ps = CN; |
481 | 481 | char *port = CN; |
482 | 482 | Boolean resolving; |
... | ... | @@ -555,6 +555,8 @@ static int do_connect(H3270 *hSession, const char *n) |
555 | 555 | return -1; |
556 | 556 | } |
557 | 557 | |
558 | + chost = lib3270_free(chost); | |
559 | + | |
558 | 560 | /* Still thinking about it? */ |
559 | 561 | if (resolving) |
560 | 562 | { | ... | ... |
src/lib3270/testprogram.c