projects
/
platform
/
upstream
/
rpm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
484c325
)
1) don't malloc() 0
author
ewt
<devnull@localhost>
Sat, 11 Apr 1998 16:05:42 +0000
(16:05 +0000)
committer
ewt
<devnull@localhost>
Sat, 11 Apr 1998 16:05:42 +0000
(16:05 +0000)
2) fixed some memory leaks
CVS patchset: 2086
CVS date: 1998/04/11 16:05:42
lib/header.c
patch
|
blob
|
history
diff --git
a/lib/header.c
b/lib/header.c
index
dcd21cd
..
ecaabe6
100644
(file)
--- a/
lib/header.c
+++ b/
lib/header.c
@@
-1681,7
+1681,7
@@
static char * singleSprintf(Header h, struct sprintfToken * token,
}
alloced = condNumFormats * 20;
- val = malloc(alloced);
+ val = malloc(alloced
? alloced : 1
);
*val = '\0';
len = 0;
@@
-1783,6
+1783,8
@@
void freeExtensionCache(const struct headerSprintfExtension * extensions,
else
ext++;
}
+
+ free(cache);
}
char * headerSprintf(Header h, const char * origFmt,
@@
-1832,6
+1834,7
@@
char * headerSprintf(Header h, const char * origFmt,
free(fmtString);
freeExtensionCache(extensions, extCache);
+ free(format);
return answer;
}