summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2009-07-22 12:37:34 -0400
committerStephen Gallagher <sgallagh@redhat.com>2009-07-22 14:11:23 -0400
commit7a827daa1a15b68fde330143ae5e55cea2760d8a (patch)
tree948a405d07eb611eff8848de83792b32ba207411 /server
parent660b9cba0748e4f625f52658b7761a0999f81d38 (diff)
downloadsssd-7a827daa1a15b68fde330143ae5e55cea2760d8a.tar.gz
sssd-7a827daa1a15b68fde330143ae5e55cea2760d8a.tar.bz2
sssd-7a827daa1a15b68fde330143ae5e55cea2760d8a.zip
Minor cleanups in monitor.c
1) Forgot to check for successful allocation 2) Used the wrong mem_ctx when allocating a timer event.
Diffstat (limited to 'server')
-rw-r--r--server/monitor/monitor.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/server/monitor/monitor.c b/server/monitor/monitor.c
index 269fcbf5..4e92213e 100644
--- a/server/monitor/monitor.c
+++ b/server/monitor/monitor.c
@@ -1308,6 +1308,10 @@ static void process_config_file(struct tevent_context *ev,
* so that read ptr is in the right place
*/
name = talloc_size(tmp_ctx, len);
+ if (!name) {
+ talloc_free(tmp_ctx);
+ return;
+ }
total_len = 0;
while (total_len < in_event->len) {
len = read(file_ctx->mt_ctx->inotify_fd, &name, in_event->len);
@@ -1355,7 +1359,7 @@ static void process_config_file(struct tevent_context *ev,
rw_ctx->cb = cb;
rw_ctx->file_ctx = file_ctx;
- tev = tevent_add_timer(ev, ev, tv, rewatch_config_file, rw_ctx);
+ tev = tevent_add_timer(ev, rw_ctx, tv, rewatch_config_file, rw_ctx);
if (te == NULL) {
DEBUG(0, ("Could not restore inotify watch. Quitting!\n"));
close(file_ctx->mt_ctx->inotify_fd);