Imported Upstream version 1.8.7
[debian/sudo] / plugins / sample / sample_plugin.c
index a8d4118b791282711ad99e87d7dd1139155ded53..faa4ea6baee0642c5270f5d1fb958d6213c0bffe 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2011 Todd C. Miller <Todd.Miller@courtesan.com>
+ * Copyright (c) 2010-2013 Todd C. Miller <Todd.Miller@courtesan.com>
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -17,7 +17,6 @@
 #include <config.h>
 
 #include <sys/types.h>
-#include <sys/param.h>
 #include <sys/stat.h>
 #include <sys/wait.h>
 
@@ -306,6 +305,7 @@ find_editor(int nfiles, char * const files[], char **argv_out[])
     cp = strtok(editor, " \t");
     if (cp == NULL ||
        (editor_path = find_in_path(editor, plugin_state.envp)) == NULL) {
+       free(editor);
        return NULL;
     }
     if (editor_path != editor)
@@ -503,7 +503,7 @@ struct policy_plugin sample_policy = {
  * Note: This plugin does not differentiate between tty and pipe I/O.
  *       It all gets logged to the same file.
  */
-struct io_plugin sample_io = {
+__dso_public struct io_plugin sample_io = {
     SUDO_IO_PLUGIN,
     SUDO_API_VERSION,
     io_open,