projects
/
oweals
/
uci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
376fdc7
)
file: add missing return code check for mktemp()
author
Felix Fietkau
<nbd@openwrt.org>
Thu, 24 Oct 2013 21:25:02 +0000
(23:25 +0200)
committer
Felix Fietkau
<nbd@openwrt.org>
Thu, 24 Oct 2013 21:25:02 +0000
(23:25 +0200)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
file.c
patch
|
blob
|
history
diff --git
a/file.c
b/file.c
index 44b2e0232cac0dc592301c010e792aba65d12674..36bfdda7272dbb4409442932158293436c345da2 100644
(file)
--- a/
file.c
+++ b/
file.c
@@
-702,7
+702,9
@@
static void uci_file_commit(struct uci_context *ctx, struct uci_package **packag
if ((asprintf(&filename, "%s/.%s.uci-XXXXXX", ctx->confdir, p->e.name) < 0) || !filename)
UCI_THROW(ctx, UCI_ERR_MEM);
- mktemp(filename);
+ if (!mktemp(filename))
+ *filename = 0;
+
if (!*filename) {
free(filename);
UCI_THROW(ctx, UCI_ERR_IO);