shared/optparser.c: fix small memleak

git-svn: trunk@4574
0.95
Tomasz Kojm 17 years ago
parent 3f7802c93e
commit 1f95badf6a
  1. 4
      ChangeLog
  2. 2
      shared/optparser.c

@ -1,3 +1,7 @@
Mon Dec 22 16:12:27 CET 2008 (tk)
---------------------------------
* shared/optparser.c: fix small memleak
Thu Dec 18 20:52:00 CET 2008 (tk)
---------------------------------
* shared/optparser.c, freshclam: use the new option parser (bb#1215)

@ -446,6 +446,7 @@ static int optaddarg(struct optstruct *opts, const char *name, const char *strar
if(pt->multiple) {
if(!pt->active) {
if(strarg) {
free(pt->strarg);
pt->strarg = strdup(strarg);
if(!pt->strarg) {
fprintf(stderr, "ERROR: optaddarg: strdup() failed\n");
@ -478,6 +479,7 @@ static int optaddarg(struct optstruct *opts, const char *name, const char *strar
return 0;
if(strarg) {
free(pt->strarg);
pt->strarg = strdup(strarg);
if(!pt->strarg) {
fprintf(stderr, "ERROR: optaddarg: strdup() failed\n");

Loading…
Cancel
Save