You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by om...@apache.org on 2011/03/04 04:29:13 UTC

svn commit: r1076999 - /hadoop/common/branches/branch-0.20-security-patches/src/c++/task-controller/task-controller.c

Author: omalley
Date: Fri Mar  4 03:29:13 2011
New Revision: 1076999

URL: http://svn.apache.org/viewvc?rev=1076999&view=rev
Log:
commit c76bb66bf933e72b68bd477f661bad071a12f250
Author: Yahoo\! <lt...@yahoo-inc.com>
Date:   Thu Sep 10 22:41:37 2009 -0700

    HADOOP:5420 Update the patch to fix a memory leak

Modified:
    hadoop/common/branches/branch-0.20-security-patches/src/c++/task-controller/task-controller.c

Modified: hadoop/common/branches/branch-0.20-security-patches/src/c++/task-controller/task-controller.c
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/c%2B%2B/task-controller/task-controller.c?rev=1076999&r1=1076998&r2=1076999&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/c++/task-controller/task-controller.c (original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/c++/task-controller/task-controller.c Fri Mar  4 03:29:13 2011
@@ -74,6 +74,7 @@ int change_user(const char * user) {
 // function to check if the passed tt_root is present in hadoop.tmp.dir
 int check_tt_root(const char *tt_root) {
   char ** mapred_local_dir;
+  char ** iter;
   int found = -1;
 
   if (tt_root == NULL) {
@@ -81,17 +82,18 @@ int check_tt_root(const char *tt_root) {
   }
 
   mapred_local_dir = (char **)get_values(TT_SYS_DIR_KEY);
+  iter = mapred_local_dir;
 
   if (mapred_local_dir == NULL) {
     return -1;
   }
 
-  while(*mapred_local_dir != NULL) {
-    if(strcmp(*mapred_local_dir,tt_root) == 0) {
+  while(*iter != NULL) {
+    if(strcmp(*iter, tt_root) == 0) {
       found = 0;
       break;
     }
-    ++mapred_local_dir; 
+    ++iter; 
   }
   free(mapred_local_dir);
   return found;