diff --git a/NEWS b/NEWS
index 6c308c2f4c01f1aa5552ce82eeee295757ec8bf9..7be98410036f13b4e9f3dd254fb47c39c82871fb 100644
--- a/NEWS
+++ b/NEWS
@@ -324,6 +324,7 @@ documents those changes that are of interest to users and administrators.
     with CR_PACK_NODES.
  -- Do not requeue a batch job from slurmd daemon if it is killed while in
     the process of being launched (a race condition introduced in v14.03.9).
+ -- Do not let srun overwrite SLURM_JOB_NUM_NODES if already in an allocation.
 
 * Changes in Slurm 14.03.10
 ===========================
diff --git a/src/srun/srun.c b/src/srun/srun.c
index 2df767753150173530ef8fc46c05b9bb0e973871..19fa93e600ae0177774b0f1949c028ae1661c2cd 100644
--- a/src/srun/srun.c
+++ b/src/srun/srun.c
@@ -221,7 +221,11 @@ int srun(int ac, char **av)
 		env->select_jobinfo = job->select_jobinfo;
 		env->nodelist = job->nodelist;
 		env->partition = job->partition;
-		env->nhosts = job->nhosts;
+		/* If we didn't get the allocation don't overwrite the
+		 * previous info.
+		 */
+		if (got_alloc)
+			env->nhosts = job->nhosts;
 		env->ntasks = job->ntasks;
 		env->task_count = _uint16_array_to_str(job->nhosts, tasks);
 		env->jobid = job->jobid;