Browse code

Fix previous commit

Shawn webb authored on 2012/07/05 23:47:30
Showing 1 changed files
... ...
@@ -143,7 +143,8 @@ virusaction (const char *filename, const char *virname,
143 143
         (char *) calloc (len + v * strlen (virname) + 1, sizeof (char));
144 144
     if (!buffer_cmd)
145 145
     {
146
-        xfree(path);
146
+        if (path)
147
+            xfree(env[0]);
147 148
 
148 149
         xfree (buffer_file);
149 150
         xfree (buffer_vir);
... ...
@@ -180,7 +181,8 @@ virusaction (const char *filename, const char *virname,
180 180
         pthread_mutex_unlock(&virusaction_lock);
181 181
         logg ("!VirusEvent: fork failed.\n");
182 182
     }
183
-    xfree(path);
183
+    if (path)
184
+        xfree(env[0]);
184 185
 
185 186
     xfree (buffer_cmd);
186 187
     xfree (buffer_file);