summaryrefslogtreecommitdiff
path: root/source3/smbd/process.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-04-02 15:54:49 +0200
committerVolker Lendecke <vl@samba.org>2008-04-14 13:13:46 +0200
commita4c0812af0132476dfd542ca212304de898fa7c7 (patch)
treeb3ba22b12fef8616ef11c096d2ffddd3064d4f29 /source3/smbd/process.c
parent394150d2692ff1249d0945f719202fdf287ff42e (diff)
downloadsamba-a4c0812af0132476dfd542ca212304de898fa7c7.tar.gz
samba-a4c0812af0132476dfd542ca212304de898fa7c7.tar.bz2
samba-a4c0812af0132476dfd542ca212304de898fa7c7.zip
Fix some "ignoring asprintf result" warnings
(This used to be commit 155d62ddfd3584d44a493c2aa1ea7f096bcff432)
Diffstat (limited to 'source3/smbd/process.c')
-rw-r--r--source3/smbd/process.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index 88684315cc..5946989ae7 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -1259,8 +1259,10 @@ void reply_outbuf(struct smb_request *req, uint8 num_words, uint32 num_bytes)
if ((num_bytes > 0xffffff)
|| ((num_bytes + smb_size + num_words*2) > 0xffffff)) {
char *msg;
- asprintf(&msg, "num_bytes too large: %u",
- (unsigned)num_bytes);
+ if (asprintf(&msg, "num_bytes too large: %u",
+ (unsigned)num_bytes) == -1) {
+ msg = CONST_DISCARD(char *, "num_bytes too large");
+ }
smb_panic(msg);
}
@@ -1298,9 +1300,8 @@ static void smb_dump(const char *name, int type, const char *data, ssize_t len)
if (len < 4) len = smb_len(data)+4;
for (i=1;i<100;i++) {
- asprintf(&fname, "/tmp/%s.%d.%s", name, i,
- type ? "req" : "resp");
- if (!fname) {
+ if (asprintf(&fname, "/tmp/%s.%d.%s", name, i,
+ type ? "req" : "resp") == -1) {
return;
}
fd = open(fname, O_WRONLY|O_CREAT|O_EXCL, 0644);