summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-06-18 09:45:18 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:17:36 -0500
commit8961048d2450e01fd44d33d2c514775b071064e0 (patch)
treecf4cd1fd08f74d4a1f9f20ae354ce53ba02111c6 /source3
parentec49dff32649b009299978cec5899d03f0fff07b (diff)
downloadsamba-8961048d2450e01fd44d33d2c514775b071064e0.tar.gz
samba-8961048d2450e01fd44d33d2c514775b071064e0.tar.bz2
samba-8961048d2450e01fd44d33d2c514775b071064e0.zip
r16339: Fix Klocwork ID
277 278 (cmd_*) 485 487 488 (ldap.c) Volker (This used to be commit 5b1eba76b3ec5cb9b896a9a5641b4d83bdbdd4cf)
Diffstat (limited to 'source3')
-rw-r--r--source3/libads/ldap.c8
-rw-r--r--source3/rpcclient/cmd_samr.c13
-rw-r--r--source3/rpcclient/cmd_spoolss.c4
3 files changed, 23 insertions, 2 deletions
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index 13459ba40d..397d8c02f0 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -904,7 +904,13 @@ char *ads_get_dn_canonical(ADS_STRUCT *ads, void *msg)
**/
char *ads_parent_dn(const char *dn)
{
- char *p = strchr(dn, ',');
+ char *p;
+
+ if (dn == NULL) {
+ return NULL;
+ }
+
+ p = strchr(dn, ',');
if (p == NULL) {
return NULL;
diff --git a/source3/rpcclient/cmd_samr.c b/source3/rpcclient/cmd_samr.c
index cbf638e7e6..1a204e70bc 100644
--- a/source3/rpcclient/cmd_samr.c
+++ b/source3/rpcclient/cmd_samr.c
@@ -1680,7 +1680,12 @@ static NTSTATUS cmd_samr_lookup_names(struct rpc_pipe_client *cli,
/* Look up names */
num_names = argc - 2;
- names = TALLOC_ARRAY(mem_ctx, const char *, num_names);
+ if ((names = TALLOC_ARRAY(mem_ctx, const char *, num_names)) == NULL) {
+ rpccli_samr_close(cli, mem_ctx, &domain_pol);
+ rpccli_samr_close(cli, mem_ctx, &connect_pol);
+ result = NT_STATUS_NO_MEMORY;
+ goto done;
+ }
for (i = 0; i < argc - 2; i++)
names[i] = argv[i + 2];
@@ -1747,6 +1752,12 @@ static NTSTATUS cmd_samr_lookup_rids(struct rpc_pipe_client *cli,
num_rids = argc - 2;
rids = TALLOC_ARRAY(mem_ctx, uint32, num_rids);
+ if ((rids = TALLOC_ARRAY(mem_ctx, uint32, num_rids)) == NULL) {
+ rpccli_samr_close(cli, mem_ctx, &domain_pol);
+ rpccli_samr_close(cli, mem_ctx, &connect_pol);
+ result = NT_STATUS_NO_MEMORY;
+ goto done;
+ }
for (i = 0; i < argc - 2; i++)
sscanf(argv[i + 2], "%i", &rids[i]);
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c
index f04b6a8ec9..7f8bbbcd8c 100644
--- a/source3/rpcclient/cmd_spoolss.c
+++ b/source3/rpcclient/cmd_spoolss.c
@@ -2454,6 +2454,10 @@ static WERROR cmd_spoolss_rffpcnex(struct rpc_pipe_client *cli,
option.count = option.ctr.count = 2;
option.ctr.type = TALLOC_ARRAY(mem_ctx, SPOOL_NOTIFY_OPTION_TYPE, 2);
+ if (option.ctr.type == NULL) {
+ result = WERR_NOMEM;
+ goto done;
+ }
ZERO_STRUCT(option.ctr.type[0]);
option.ctr.type[0].type = PRINTER_NOTIFY_TYPE;